Upload Options

Upload options are HTTP headers that can be used to change various settings for file uploads.

Headers

HeaderDescription
x-zipline-deletes-atA relative time or JavaScript resolvable date string that specifies when the file should be deleted.
x-zipline-formatOne of random, date, uuid, name, gfycat. This will change the format of the file name. See here for more.
x-zipline-image-compression-percentA number between 0 and 100 that specifies the image compression percentage.
x-zipline-passwordIf set, the file will have a password protected dialog upon viewing.
x-zipline-max-viewsThe maximum number of views before the file is deleted.
x-zipline-no-jsonReturns file urls seperated by a newline instead of JSON. See here for more.
x-zipline-original-nameMust be true to have the original file name saved. See here for more.
x-zipline-folderA folder ID to automatically upload the file to.
x-zipline-filenameThis header will override the filename of the file, it supercedes the x-zipline-format
x-zipline-domainInstead of using the domain of the request, use this domain for the file URL. See here for more.
x-zipline-file-extensionThis header will override the file extension of the file.

All headers are optional, except authorization, which is your token.


File Format

FormatExample
randomDh39ck.png
date2021-01-01.pngUses the Files Default Date Format in settings
uuidb79c332b-306e-47ff-b564-2514075122fe.png
namefilesOriginalNameWhenUploaded.png
gfycat

File Expiration

The x-zipline-deletes-at header can be used to specify when the file should be deleted. This can be a relative time or a JavaScript resolvable date string.

If using a relative time, feel free to use the ms guide to help you calculate the time.

X-Zipline-Deletes-At: 1d

This will delete the file in 1 day from the time of upload.

JavaScript Resolvable Date String

A JavaScript resolvable date string is a string that can be resolved to a date object in JavaScript. This can be used to set a specific date and time for the file to be deleted.

When using this, the header's value must be prefixed with date=

X-Zipline-Deletes-At: date=2025-01-01T00:00:00Z

This will delete the file on January 1st, 2025 at midnight UTC.

Image Compression

The x-zipline-image-compression-percent header can be used to specify the image compression percentage. This will only work for images.

no compression
No compression
compression
Compression at 20%

Original Name

When using the x-zipline-original-name header, the original file name will be saved. This does not affect the file name when it is saved, only when downloading the file.

original name
The file's original name can be seen in the title, while the URL has the random name.

Override Domain

If specified, the domain in the file URL will be replaced with the domain specified in the x-zipline-domain header.

POST https://zipline.otherdomain.com/api/upload
X-Zipline-Domain: zipline.example.com

-> https://zipline.example.com/abc123.png instead of https://zipline.otherdomain.com/abc123.png

The domain must point towards the Zipline instance in DNS, obviously.



Last updated: 2/2/2025
Edit this page on GitHub