Upload Examples (form/multipart)

Upload example (form/multipart)#

Copy the examples below and replace the subdomain subdomain with your own airstore subdomain to get started.

This is the most common method in web. This is the same method as the one used to upload files through forms on a website. The form property name is file (even if there is only one file).

Example using cURL one-liner#

Create a random file myfile.txt

echo 'Hello world' > myfile.txt

Upload that file (simple example)

curl -X POST -F file=@myfile.txt \
     -H "X-Airstore-Secret-Key: 00000000111122223333444444444444" \
     "https://subdomain.api.airstore.io/v1/upload?dir=/backups/2019-01/"

You should see a response like this

{
    "status": "success",
    "file": {
        "size": 395313152,
        "meta": {},
        "uuid": "65681afd-cc5b-5d5a-b059-a25e2a43c339",
        "url_permalink": "https://subdomain.api.airstore.io/v1/get/_/65681afd-cc5b-5d5a-b059-a25e2a43c339/some-container1.tgz",
        "url_public": "https://subdomain.airstore.io/backups/2019-01/some-container.tgz",
        "type": null,
        "properties": {},
        "name": "some-container1.tgz"
    },
    "info": {
        ...
    }
}

Example with Insomnia App#

This is how it should look if you're using Insomnia App to create a new file. Be sure to use the "Multipart" tab and to add a file under the file key (lowercase).