File Processor
processor
File processing and storage utilities.
This module handles saving resume files to both the database and S3-compatible storage (Garage).
Functions
save_file
async
Save a resume file to database and S3 storage.
Creates a database record for the resume and uploads the file bytes
to S3-compatible storage (Garage). The file path follows the pattern:
resumes/{user_id}/{file_name}.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
str
|
ID of the user uploading the file. |
required |
file
|
bytes
|
File contents as bytes. |
required |
file_name
|
str
|
Original filename. |
required |
db
|
AsyncSession
|
Database session (will be closed after use). |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if successful. |
Raises:
| Type | Description |
|---|---|
ProcessingException
|
If database save fails (integrity error or other). |