Designer API
Control the Webflow Designer
asset.setFile(fileBlob)
Set the file of an asset. Use this method to replace the file of an existing asset with a new file.
1asset.setFile(fileBlob: File): Promise<null>
fileBlob
A Promise that resolves to null.
null
1const assets = await webflow.getAllAssets();2const asset = assets[0];3const newFile = new File([blob], 'marvin-smiling.png', { type: 'image/png' });4await asset.setFile(newFile);
Try this example