File Upload
Simple file upload.
Endpoint
http
POST /api/v1/shares/{token}/uploadsParameters
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | yes | - |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | The file name, must be the same for all file chunks |
file | file | yes | The file or part of the file as a chunk |
extension | string | yes | The file extension |
path | string | no | The directory path of the file. Use it when you'd like to upload folder and recreate folder structure in the backend. E.g. /Documents/Photos/wallpaper.jpg |
parent_id | uuid | no | The uuid of the parent folder. If it's not set, then the files will be uploaded into home location |
Request example
sh
curl --location --request POST 'https://files.ro/api/v1/shares/{token}/uploads' \
--header 'Content-Type: multipart/form-data' \
--form 'name=filesro-hero' \
--form 'file=@/path/to/file' \
--form 'extension=jpg'Response
json
{
"data": {
"id": "file_123",
"type": "file",
"attributes": {
"filesize": "1.2 MB",
"name": "report.pdf",
"basename": "report-uuid.pdf",
"mimetype": "application/pdf",
"file_url": "https://files.ro/file/report-uuid.pdf",
"thumbnail": "https://files.ro/thumbnail/report-uuid.jpg",
"parent_id": "folder_123",
"created_at": "01. Jan. 2024",
"updated_at": "02. Jan. 2024",
"deleted_at": null
},
"relationships": {
"shared": {
"data": {
"id": "share_123",
"type": "shared",
"attributes": {
"permission": "editor",
"protected": false,
"item_id": "item_123",
"expire_in": 24,
"token": "share_token",
"link": "https://files.ro/share/share_token",
"type": "folder"
}
}
},
"parent": {
"data": {
"type": "folder",
"id": "folder_123",
"attributes": {
"name": "Projects"
}
}
},
"creator": {
"data": {
"type": "creator",
"id": "user_123",
"attributes": {
"name": "Jane Doe",
"avatar": "https://files.ro/storage/avatars/jane.png",
"color": "#00BC7E"
}
}
},
"exif": {
"data": {
"type": "exif",
"id": "exif_123",
"attributes": {
"date_time_original": "2024-01-01",
"artist": "Jane Doe",
"height": 1080,
"width": 1920,
"x_resolution": "72",
"y_resolution": "72",
"color_space": "sRGB",
"camera": "Canon",
"model": "EOS",
"aperture_value": 2.8,
"exposure_time": "1/125",
"focal_length": "50mm",
"iso": 100,
"aperture_f_number": 2.8,
"ccd_width": "5.76mm",
"longitude": "0.0000",
"latitude": "0.0000"
}
}
}
}
}
}json
{
"type": "error",
"message": "Access Denied"
}