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

File Export (Save To) - Export a File to Cloud Service

When a user creates content in your application, generates a report, or finds something that they want to save for later, they'd love to take that content and send it directly to dropbox, google drive, evernote, or even as an email attachment, rather than downloading it to their local device. This is especially true for mobile web sites, where the local filesystem is essentially a black hole.

The Filestack javascript library allows you to accomplish this easily with only a few lines of code.

Export is basically the opposite of filepicker.pick, in that it takes a Blob and lets the user specify where to send it to.

Url file export
filepicker.exportFile( '', { mimetype:'image/jpeg', suggestedFilename: 'newFile' }, function(Blob){ console.log(Blob.url); } );
Blob file export
var blob = { url: '', filename: 'hello.txt', mimetype: 'text/plain', isWriteable: true, size: 100 }; filepicker.exportFile( blob, function(Blob){ console.log(Blob.url); } );


filepicker.exportFile(input, picker_options, onSuccess(Blob){}, onError(FPError){}, onProgress(FPProgress){})
input A Blob or URL pointing to data you'd like to export. If you have a DOM File object or raw data, you can use the call to first generate a Blob

An optional dictionary of key-value pairs that specify how the picker behaves:


{mimetype: 'image/png'}

The mimetype of the file. Note that we try to guess the file extension of the file from this, so image/png will result in a .png ending while image/* will not have an ending. If you don't specify the mimetype, we will try to guess, otherwise we will fall back to letting the user save the file as whatever extension they choose, which may cause issues (if they try to save text to Facebook, for instance).


{extension: '.pdf'}

The extension of the content you want the user to save. Like mimetype, this is used to suggest a filename and prevent the file from being saved to services that don't support it (Sending text to Facebook, for instance). Do not use both extension and mimetype at the same time.


{suggestedFilename: 'newFile'}

Provide a recommended file name. The user will always be able to overwrite but you'll be able to set the default name.


{container: 'modal'}

Where to load the Filestack UI into. Possible values are "window", "modal", or the id of an iframe in the current document. Defaults to "modal" for desktop browsers and 'window' for mobile browsers.


{language: 'es'}

Specify the filestack dialog language version. If not set, it will use language detected in browser. If detected language is unavaliable, the default value is 'en'.

Currently, supported languages:

  • Czech: 'cs'
  • German: 'de'
  • English: 'en'
  • Spanish: 'es'
  • Spanish (Mexican): 'es_mx'
  • Faroese: 'fo'
  • French: 'fr'
  • Canadian French: 'fr_ca'
  • Hebrew: 'he'
  • Italian: 'it'
  • Dutch: 'nl'
  • Danish: 'da'
  • Norwegian: 'no'
  • Polish: 'pl'
  • Portuguese: 'pt'
  • Portuguese (Brazilian): 'pt_br'
  • Russian: 'ru'
  • Swedish: 'sv'
  • Turkish: 'tr'
  • Chinese (Taiwan): 'zh_tw'
  • Greek: 'el'
  • Spanish (Argentina): 'es_ar'
  • Finnish: 'fi'
  • Indonesian: 'id'
  • Korean: 'ko'
  • Slovak: 'sk'
  • Ukrainian: 'uk'
  • Chinese: 'zh'
  • Serbian: 'sr'
  • Bulgarian: 'bg'
  • Malay: 'ms'
  • Hungarian: 'hu'
  • Vietnamese: 'vi'

If you would like to co-create the translation to any language, please contact us.


{service: 'FACEBOOK'}
{services: ['FACEBOOK','BOX',…]}

Specify which services are displayed on the left panel, and in which order, by name.

Be sure that the services you select are compatible with the mimetype(s) or extension(s) specified.

Currently, Filestack supports the following services, and we're adding more all the time:

  • BOX
  • FTP

For all new applications, it is required to set your own Dropbox OAuth keys in order to use the Dropbox service with Filestack. More info

The COMPUTER service should be specified if you want users to be able to select files from their local device (their desktop or mobile device). To learn more about local file uploads Click Here

Default Location

{openTo: 'BOX'}

Specifies which service to show upon opening.


{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

Custom css

{customCss: '//'}

Allow to set custom css file url per dialog instance. You can set this option also in developer portal for all application integrations. Since dialog v2 was completely rebuilt from the ground up, custom css files from v1 will not work correctly with it. For more information about using custom css with v2 click here. CustomCss is only available on paid Filestack plans.

Custom CSS is only available on the STARTER and higher plans. Choose Plan

Custom Dialog Text

{customText: '//'}

Allows a user to provide their own text for the Filestack dialog. Url should use https protocol. Here is a sample JSON file including the English text for the dialog that can be used as a base for your custom text: English_Dialog_Text.JSON Your custom text must include all the keys present in this file. The values can be blank if you choose. Other language files are available by using the language code to modify the url linking to this French translation file, so es.js for Spanish, ru.js for Russian, pl.js for Polish, etc. The sample French file above contains variables that look like this: __variable__, however in order to work with the customText picker option, these variables must adhere to this format: {{variable}}.


The function to call if a file is exported successfully.

We'll return a Blob of the newly exported file 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 exporting a file.

Possible error codes on the FPError:

131 The user closed the dialog without exporting a file

For more info about FPErrors, see Error Handling.


The function that is called on uploading progress events. The function will show the percent completed as a number out of 100. Multiple mode provides separate callbacks for all selected files.

We'll retrun a JSON object with the following properties:

progress Current progress as a float number.
filename The filename of the file being uploaded.
mimetype The mimetype of the file being uploaded.
size The size of the file being uploaded in bytes if available.

Sample response