Retrieve file from S3
GET/truckers/files/
Retrieves a file stored in Amazon S3.
This endpoint allows you to retrieve generic files (PDFs, images, binaries) previously uploaded to the system. It requires JWT authentication and the exact name of the file to be retrieved.
Use Cases:
- Download PDF documents such as invoices or contracts
- View profile pictures or scanned documents
- Retrieve specific binary files
Example:
GET /?file=factura_12345.pdf
Request
Responses
- 200
- 404
- 500
File successfully retrieved from S3.
The returned content varies depending on the requested file type:
- PDF: application/pdf
- Images: image/jpeg or image/png
- Other types: application/octet-stream
Successful response example:
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename=invoice_12345.pdf
[binary data]
The requested file does not exist in S3.
Possible causes:
- Incorrect file name
- The file was deleted
- The file was never uploaded
Example response:
{
error: File not found,
message: The requested file does not exist
}
Internal server error while attempting to retrieve the file.
Possible causes:
- S3 connection issues
- Insufficient permissions
- Unexpected server error
Example response:
{
error: Internal Server Error,
message: Could not retrieve the file
}