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

Removing a File with the Javascript API

If you need to delete a file because you no longer want it around, you can delete it from Filestack and any underlying storage

Sample Code
console.log("Storing..."); "Test text", function(Blob){ console.log("Removing..."); filepicker.remove( Blob, function(){ console.log("Removed"); } ); } );


filepicker.remove(Blob, security_options, onSuccess(Blob){}, onError(FPError){})
Blob A Blob pointing to the file you'd like to remove. Note that if the Blob was pulled from a user's cloud storage service (Dropbox, etc.), the remove will not delete the file from the user's cloud storage, but if the Blob was generated by a store operation or loaded from the user's computer, the remove will delete the stored copy.
security options

An optional dictionary of key-value pairs that configure the remove.


{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

onSuccess The function to call if the remove is successful. There are no parameters passed to the callback.

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

Possible error codes on the FPError:

171 The file cannot be found, and may have already been deleted
172 The underlying content store could not be reached

For more info about FPErrors, see Error Handling.