Store a File with the REST API

Similar to the call in javascript, you can use the Filepicker files library to send files directly to your S3 bucket (or other cloud storage) and get back a Blob for further operations. To do this, issue a POST to the /api/store/S3 endpoint (can also be gcs, azure, rackspace or dropbox), along with your apikey, the file, and any optional parameters you want to include.


>>> curl -X POST -F fileUpload=@filename.txt ""
{"url": "", "size": 234, "type": "text/plain", "filename": "tester.txt", "key": "1ilWxmaRRqhMd2vSbSyB_tester.txt"}

>>> curl -X POST -d url=""
{"url": "", "size": 8331, "type": "image/png", "filename": "watermark.png", "key": "a1RyBxiglW92bS2SRmqM_watermark.png"}

>>> curl  -X POST  -d  url=""  ""
{"container": "custom_source", "url": "", "filename": "watermark.png", "key": "myfiles/1234.png", "type": "image/png", "size": 8331}

If you set additional REST parameters make sure that the URL is given in quotes.

Store Location
{S3, gcs, azure, rackspace, dropbox}

Set the store parameter directly after the slash /api/store/S3. Where to store the file. The default is S3. Other options are 'azure','dropbox', 'rackspace' and 'gcs'. You must have configured your storage in the developer portal to enable this feature.


The name of the file as it will be stored. If this isn't provided, we do the best we can to come up with one.


The type of the file as it will be stored. If this isn't provided, we do the best we can, defaulting to "text/plain" if you give us raw data.


The path to store the file at within the specified file store. For S3, this is the key where the file will be stored at. By default, Filestack stores the file at the root at a unique id, followed by an underscore, followed by the filename, for example "3AB239102DB_myphoto.png".


The bucket or container in the specified file store where the file should end up. This is especially useful if you have different containers for testing and production and you want to use them both on the same Filestack app. If this parameter is omitted, the file is stored in the default container specified in your developer portal.

Note that this parameter does not apply to the Dropbox file store.

Public Access

Indicates that the file should be stored in a way that allows public access going directly to the underlying file store. For instance, if the file is stored on S3, this will allow the S3 url to be used directly. This has no impact on the ability of users to read from the Filestack file URL. Defaults to 'private'.

Base64 Decoding

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.


If you have security enabled, you'll need to have 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