This section provides detailed information about the file upload API, which allows you to upload files to our server.
API Endpoint
The file upload API is accessible at /en/tools/api-reference/file-upload
.
Usage
To upload a file, you need to send a POST request to the API endpoint with the file data. Here's an example of how to use the API:
- Method: POST
- URL:
/en/tools/api-reference/file-upload
- Headers:
Content-Type: multipart/form-data
- Body:
file
: The file to be uploaded.
Example Request
curl -X POST https://yourserver.com/en/tools/api-reference/file-upload \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/file.jpg"
Response
Upon successful upload, the API will return a JSON response containing the file's metadata:
{
"status": "success",
"message": "File uploaded successfully",
"data": {
"filename": "your_file.jpg",
"size": "123456",
"url": "/files/your_file.jpg"
}
}
Error Handling
If an error occurs during the file upload process, the API will return an error message:
{
"status": "error",
"message": "Error uploading file: <error_message>"
}
Further Reading
For more information about our APIs, please visit our API Documentation.
File Upload