{% extends 'layouts/base.njk' %} {% set title = app.name + ' - File upload' %} {% block scripts %} {% endblock %} {% block body %}

Upload files

(except illegal ones)

Upload a file

{{ macros.field(_locals, 'file', 'upload', '', 'Choose wisely', 'The maximum upload size is ' + max_upload_size + 'MiB', validation_attributes='required') }} {{ macros.field(_locals, 'number', 'expire_after_days', '30', 'How many days to delete this file after', null, validation_attributes='max="1825"') }} {{ macros.field(_locals, 'checkbox', 'never_expire', '', 'Never delete this file') }} {{ macros.field(_locals, 'text', 'slug', '', 'Custom url slug', 'Example: beautiful_image.jpg sets url to https://ily.li/beautiful_image.jpg', validation_attributes='disabled') }} {{ macros.field(_locals, 'checkbox', 'autogen_url', '', 'Generate url automatically', null, validation_attributes='checked') }} {{ macros.csrf(getCSRFToken) }}

Setup a desktop utility

There may be a desktop client at some point. For now, if you're an advanced user, you can setup scripts/macros.

To upload the file, you must:

Field name Description Optional? Example
upload The file field No -
ttl How much time (in seconds) to keep the file Yes 0 (never delete), 30 (delete after 30s)

Example with curl:

curl -X POST -H 'Accept: application/json' \
-H "Authorization: very_secret_and_personal_token" \
-F 'upload=@path/to/local/file' \
https://ily.li/
curl -X PUT -H 'Accept: application/json' \
-H "Authorization: very_secret_and_personal_token" \
-F 'upload=@path/to/local/file' \
https://ily.li/my_very_important_file.png
curl -X POST -H 'Accept: application/json' \
-H "Authorization: very_secret_and_personal_token" \
-F 'upload=@path/to/local/file' \
-F 'ttl=30' \
https://ily.li/

Auth tokens

{{ macros.csrf(getCSRFToken) }}
{% for token in auth_tokens %} {% endfor %}
# Secret Created at Last used at Actions
{{ token.id }}
{{ token.secret }}
{{ token.created_at.toISOString() }} {{ token.used_at.toISOString() }} Revoke
{% endblock %}