File Upload
Learn how to upload files on JigsawStack File Storage
The file upload method is ideal for files that are not larger than 100MB.
The File Storage will assume the content type of an asset automatically. However, you can specify specific file content types like image/jpeg
, image/png
, e.t.c
Initial requirements
- Setup a JigsawStack account (if you don’t have an account already)
- Get your
public
andsecret
API keys from here. - Install the Node.js SDK or Python SDK
Upload a file
Overwriting files
When uploading a file with a filename that already exists, the default behavior is to return a 400 file already exists error. If you want to overwrite a file that already exists, set overwrite
to true
Content Type
By default, the File Storage will assume the content type of an asset automatically. If you want to specify the content type for your asset simply pass the contentType option during upload.
Make your uploaded file accessible
Uploaded files are private by default. To make them public or accessible, attach your public key to the x-api-key query parameter.
Use uploaded file across other JigsawStack APIs
You can use an uploaded file across other JigsawStack APIs by using the file key
and attaching the value to the file_store_key
parameter on any API that supports it.
Was this page helpful?