/api/v1
- URL:
/api/v1/file/upload - Method:
POST - Description: Upload one or more files to the server.
- Request:
- Headers:
Content-Type: multipart/form-data - Body:
files: File(s) to upload (can be multiple)baseDir(optional): String, target directory path
- Headers:
- Response:
- 200 OK
{ } - 400 Bad Request (if file type not allowed, etc.)
- 200 OK
- URL:
/api/v1/file/ls/{dir} - Method:
GET - Description: List all files for the current user or in a specific directory.
- Query Parameters:
dir(optional): String, directory path to list
- Response:
- 200 OK
{ }
- 200 OK
- URL:
/api/v1/file/define/{id} - Method:
GET - Description: Get metadata for a specific file.
- Path Parameter:
id: File ID
- Response:
- 200 OK
{ } - 404 Not Found (if file does not exist)
- 200 OK
- URL:
/api/v1/file/download/{id} - Method:
GET - Description: Download the contents of a file.
- Path Parameter:
id: File ID
- Response:
- 200 OK
- Returns file as binary stream with appropriate
Content-Type.
- Returns file as binary stream with appropriate
- 404 Not Found
- 200 OK
- URL:
/api/v1/file/create_folder - Method:
POST - Description: Create a new folder.
- Request:
- Body:
{ "name": "New Folder", "parentDir": "some_id" }
- Body:
- Response:
- 200 OK
{ } - 400 Bad Request (if folder exists, invalid name, etc.)
- 200 OK
- URL:
/api/v1/file/{id} - Method:
DELETE - Description: Delete a file or folder by ID.
- Path Parameter:
id: File or folder ID
- Response:
- 200 OK
{ } - 404 Not Found
- 200 OK
- 400 Bad Request: Invalid input, unsupported file type, etc.
- 404 Not Found: File or folder does not exist.
- 500 Internal Server Error: Unexpected server error.
- Supported file types: txt, jpg, png, json, etc. (as per frontend restriction)
- Authentication: (If implemented) endpoints may require authentication headers (e.g., JWT).
- Pagination: (If implemented) list endpoints may support pagination via query