/api/upload
Info
Requires authentication
POST Upload a file
Headers
Upload a file to Zipline, for more options see the configuration page.
Body (multipart/form-data)
Field names of files should be file, if you want to upload multiple files then just append multiple fields with the name still being file.
200 Ok (JSON)
| Field Name | Type | Description |
|---|---|---|
files | strings[] | The URLs of the uploaded files |
expiresAt | date | The date the file will expire. For more info, refer to the upload options |
removed_gps | boolean | Whether or not the GPS data was removed from the image |
{"files": ["https://example.com/asdfgh.png"],"expiresAt": "2021-01-01T00:00:00.000Z","removed_gps": true}
{"files": ["https://example.com/asdfgh.png"],"expiresAt": "2021-01-01T00:00:00.000Z"}
{"files": ["https://example.com/asdfgh.png"]}
200 Ok (Text)
If the No-JSON header is present, it will return a text response. This is useful if you want to skip the JSON parsing, which can be slow in the case of jq.
https://example.com/asdfgh.png
Or with multiple files, it will be comma separated.
https://example.com/asdfgh.png,https://example.com/qwerty.png
400 Bad Request (JSON)
invalid date- Provided an invalid date for theExpires-Atheader.invalid date (UPLOADER_DEFAULT_EXPIRATION)- TheUPLOADER_DEFAULT_EXPIRATIONis set to an invalid date, therefore the default expiration is invalid.invalid image compression percent (invalid number)- TheImage-Compression-Percentheader is set to an invalid number.invalid image compression percent (% < 0 || % > 100)- TheImage-Compression-Percentheader is set to a number less than 0 or greater than 100.invalid max views (invalid number)- TheMax-Viewsheader is set to an invalid number.invalid max views (max views < 0)- TheMax-Viewsheader is set to a number less than 0.no files- No files were provided in the multipart/form-data body.file[i]: size too big- The file at indexiis too big.file[i]: no filename- The file at indexihas no filename.file[i]: disabled extension recieved: ext- The file at indexihas a disabled extension.file[i]: filename already exists: filename- The file at indexihas a filename that already exists. This is only possible if theX-Zipline-Filenameheader is set.
401 Forbidden (JSON)
no authorization- NoAuthorizationheader present.authorization incorrect- The providedAuthorizationheader is incorrect.
Last updated: 11/7/2023
Edit this page on GitHub