File Export (Save To) - Export a File to Cloud Service using the Filestack v2 library

When a user creates content in your application, generates a report, or finds something that they want to save for later, you can allow them to send that content directly to dropbox, google drive, evernote, or even send it via email.

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.


<script src=""></script>
<script type="text/javascript">
  filepicker.exportFile(input, picker_options, onSuccess(Blob){}, onError(FPError){}, onProgress(FPProgress){});

Example Export Code - Url file export

Launch export dialog using Filestack URL and suggested filename
filepicker.exportFile( '', { mimetype:'image/jpeg', suggestedFilename: 'newFile' }, function(Blob){ console.log(Blob.url); } );

Example Export Code - Blob file export

Launch export dialog using Filestack Blob with default filename
var blob = { url: '', filename: 'hello.txt', mimetype: 'text/plain', isWriteable: true, size: 100 }; filepicker.exportFile( blob, function(Blob){ console.log(Blob.url); } );
the file to export
string or blob
{Filestack Blob or URL}

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.
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.

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.

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 Service
openTo: 'BOX'

Specifies which service to show upon opening the picker dialog.

language: 'es'

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

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.

policy: POLICY, signature: SIGNATURE

If you have security enabled, you will need to include a valid Filestack 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