File
A File represents an uploaded blob stored in S3-compatible object storage. Each file carries metadata such as its original filename, system-generated prefixed filename, MIME type, size, directory path, and an owner identifier. Files can be public (accessible without authentication) or private (accessible only through a time-limited presigned URL).
Sample Object
{
"id": "fl_abc123def456",
"original_filename": "report.pdf",
"filename": "aB3xK9mN2p_report.pdf",
"path": "documents/project_d8lcac3epc83jq9i2d60/aB3xK9mN2p_report.pdf",
"dir_path": "documents/project_d8lcac3epc83jq9i2d60",
"type": "application/pdf",
"size": 204800,
"owner_id": "usr_abc123def456"
}Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the file. |
original_filename | string | The name of the file as provided during upload. |
filename | string | System-generated storage filename. A random 10-character prefix is prepended to the original name to prevent collisions. |
path | string | Full object key within the bucket. Constructed as {dir_path}/{filename}. Prefixed with public/ when the file is public. |
dir_path | string | Virtual directory path formatted as {directory}/project_{project_id}. |
type | string | MIME type of the file as reported by the client during upload. |
size | int64 | File size in bytes. |
owner_id | string | Unique identifier of the user who owns the file. |
Actions
Uploading a file
Upload a file through a multipart form request. The file binary is stored in S3 while the metadata is recorded in the database. Files larger than 5 MB are automatically split into chunks for multipart upload.
Getting a presigned download link
Generate a time-limited presigned URL for secure file access. The link expires after one hour and grants read access to the underlying S3 object.
Listing all files
Retrieve all files associated with the current project and tenant. The response is an array of file objects ordered by creation date.
Deleting a file
Remove a file and its associated metadata. The S3 object is deleted and the database record is marked as removed.