Storage
Upload File
API Documentation
Backend Services
GraphQL
- AI
Client Libraries
- JavaScript
- React
- Next.js
- Vue
Storage
Upload File
Upload one or multiple files at once
POST
/
files
curl --request POST \
--url https://local.storage.nhost.run/v1/files/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: multipart/form-data' \
--form 'file[]=@path-to-file'
{
"ProcessedFiles": [
{
"id": "<string>",
"name": "<string>",
"size": 123,
"bucketId": "<string>",
"eTag": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isUploaded": true,
"mimeType": "<string>",
"uploadedByUserId": "<string>",
"metadata": {}
}
]
}
curl --request POST \
--url https://local.storage.nhost.run/v1/files/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: multipart/form-data' \
--form 'file[]=@path-to-file'
Authorizations
JSON Web Token to authorize requests.
Body
multipart/form-data
Response
201
application/json
File was uploaded successfully
The response is of type object
.
curl --request POST \
--url https://local.storage.nhost.run/v1/files/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: multipart/form-data' \
--form 'file[]=@path-to-file'
{
"ProcessedFiles": [
{
"id": "<string>",
"name": "<string>",
"size": 123,
"bucketId": "<string>",
"eTag": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isUploaded": true,
"mimeType": "<string>",
"uploadedByUserId": "<string>",
"metadata": {}
}
]
}