CodeForPhilly / CodeForPhilly/balancer-main
Add Title to the DB when uploading a file.
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
Summary
When a user uploads a document via the [UploadFile](https://balancertestsite.com/UploadFile) page, the backend should automatically extract the document title (if available) and populate the title field in the database. Currently, this field is being saved as null.
Current Behavior
- Uploaded files are saved successfully.
- The title column in the database remains null.
Expected Behavior
- Upon file upload, the server should:
1. Parse the document.
2. Attempt to extract a meaningful title (e.g., from the PDF metadata, first page header, or first large/bold line).
3. Save the extracted title to the corresponding database entry.
Backend Details
Code location: server/API/views/uploadfile.py
This logic should be added during the upload process after the file has been saved and parsed.
Suggestion: Use openAI API endpoint and sent in the first 50 words of the document and ask it to extract the document title.
https://balancertestsite.com/UploadFile
https://balancertestsite.com/listoffiles


Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.