Getting Started

Filestack Architecture

File Upload

File Export (Save To)

Responsive Images

Image Transformations

Document Transformations

Video Transcoding

Audio Transcoding





Filestack Viewer


Supported Cloud Drives

Filestack Recipes

Filestack Integrations

Filestack SDKs

Register for an API key

Write a URL Back to a File - Overwrite an existing Filestack Link with a New File

In addition to writing files and raw data back to Blobs, you can write URLs back to Blobs as well.

Sample Code
/*Blob from a previous pick, etc.*/ var blob = { url: '', filename:"robot.png", mimetype:"image/png", size:28683, isWriteable:true}; console.log("Writing to "+blob.filename); filepicker.writeUrl( blob, "", function(Blob){ console.log(replaceHtmlChars(JSON.stringify(Blob))); } );


filepicker.writeUrl(target, URL, [options], onSuccess(Blob){}, onError(FPError){}, onProgress(percent){})
target A Blob pointing to the file you'd like to write to. Note that if the Blob was pulled from a user's cloud storage service (Dropbox, etc.), the write will directly modify the file in their cloud storage. If the Blob was generated by a store operation or loaded from the user's computer, the write will edit the stored copy.
URL The url to pull data from to write to the target file, as a string.

An optional dictionary of key-value pairs that configure the write

Base64 Decoding

{base64decode: true}

Specify that you want the data to be first decoded from base64 before being written to the file. For example, if you have base64 encoded image data, you can use this flag to first decode the data before writing the image file.


{policy: POLICY, signature: SIGNATURE}

If you have security enabled, you'll need to have a valid policy and signature in order to perform the requested call. This allows you to select who can and cannot perform certain actions on your site. Read more about security and how to generate policies and signatures


The function to call if the write is successful.

We'll return a Blob as a JSON object with the following properties.

url The core Filestack file url on which all other operations are based.
filename The filename of the uploaded file.
mimetype The mimetype of the uploaded file.
size The size of the uploaded file in bytes, if available.
isWriteable Whether the file can be written to using filepicker.write.

The function to call if there is an error when writing the file.

Possible error codes on the FPError:

121 The Blob to write to could not be found
122 The Remote URL could not be reached

For more info about FPErrors, see Error Handling.


The function that is called on progress events, if available. The function is called with the percent completed as a number out of 100.

Note that on older browsers, particularly IE 8 and IE 9, the browser does not provide progress events and therefore onProgress will not be called except at 100%.