Skip to content

Files

Upload File

You can upload file by using the /files/upload endpoint but in header the Content-Type should be multipart/form-data.

Request:

Terminal window
[POST] https://api.escuelajs.co/api/v1/files/upload
# Body
{
"file": "<Binary File>"
}

The response is like this:

{
"originalname": "Djhv7NO - Imgur.png",
"filename": "f3a5.png",
"location": "https://api.escuelajs.co/api/v1/files/f3a5.png"
}

Get a file

You can get a single file by adding the fileName as a parameter: /files/{fileName}

Terminal window
[GET] https://api.escuelajs.co/api/v1/files/f3a5.png