Upload a file
Learn how to upload a file to Ranoz.
When you upload a file to Ranoz via the API, more information about the file is returned, such as the url or the id, which you can then save.
Examples
To upload a file, first, extract the file's metadata (filename and size) and send a POST request to https://ranoz.gg/api/v1/files/upload_url.
This will return the file object including the url that you can store for later use.
With it the pre-signed URL. Then use a PUT request to upload the file to the pre-signed URL.
Parameter | Location | Description |
---|---|---|
filename | Body (JSON) | The name of the file you intend to upload. |
size | Body (JSON) | The size of the file in bytes. |
Again: For the actual PUT request to upload a file, on success nothing from the response is needed. We extract all data for the file from the response of the first request, i.e. before we actually upload the file.