/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-At
header.invalid date (UPLOADER_DEFAULT_EXPIRATION)
- TheUPLOADER_DEFAULT_EXPIRATION
is set to an invalid date, therefore the default expiration is invalid.invalid image compression percent (invalid number)
- TheImage-Compression-Percent
header is set to an invalid number.invalid image compression percent (% < 0 || % > 100)
- TheImage-Compression-Percent
header is set to a number less than 0 or greater than 100.invalid max views (invalid number)
- TheMax-Views
header is set to an invalid number.invalid max views (max views < 0)
- TheMax-Views
header 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 indexi
is too big.file[i]: no filename
- The file at indexi
has no filename.file[i]: disabled extension recieved: ext
- The file at indexi
has a disabled extension.file[i]: filename already exists: filename
- The file at indexi
has a filename that already exists. This is only possible if theX-Zipline-Filename
header is set.
401 Forbidden (JSON)
no authorization
- NoAuthorization
header present.authorization incorrect
- The providedAuthorization
header is incorrect.
Last updated: 3/3/2024
Edit this page on GitHub