Overview
Resume Generator accepts resume files in PDF and DOCX formats. The system uses intelligent file type detection based on magic bytes and supports both text-based and scanned documents through AI-powered parsing.Supported File Formats
The application supports two primary resume formats:- PDF (.pdf) - Portable Document Format files
- DOCX (.docx) - Microsoft Word Open XML documents
The system uses magic byte detection to identify file types, which is more reliable than relying on file extensions or MIME types, especially on Windows systems.
File Size Limits
Resume files are subject to the following constraints:- Maximum file size: 5MB
- Storage: Files are processed in memory (not stored on disk)
How File Upload Works
File Selection
Select your resume file (PDF or DOCX) from your local system. The file is attached to the
resume field in the multipart form data.File Type Detection
The server performs magic byte detection to identify the file type:
- PDF Detection: Checks for
%PDFsignature (bytes0x25 0x50 0x44 0x46) - DOCX Detection: Checks for ZIP signature
PK..(bytes0x50 0x4b 0x03 0x04)
interview.controller.js:45-47:Text Extraction
The system attempts to extract text from the uploaded file:
- PDF files: Parsed using
pdf-parselibrary - DOCX files: Parsed using
mammothlibrary for raw text extraction
interview.controller.js:56-66 for implementation details.Fallback to AI Parsing
If local text extraction fails (scanned PDFs, encrypted files, or corrupted documents), the system falls back to AI-powered parsing:
- File is encoded as base64
- Sent directly to Google Gemini AI for content extraction
- This allows processing of image-based or scanned resumes
interview.controller.js:69-82.Upload via API
Resumes are uploaded usingmultipart/form-data encoding. Here’s the complete request structure:
Request Format
JavaScript Example
interview.api.js:12-32.
cURL Example
File Processing Logic
The middleware and controller work together to process uploaded files:Middleware Configuration
Configured infile.middleware.js:4-9:
Controller Processing
The upload is handled by a single middleware function:interview.routes.js:15.
Error Handling
Common Errors
| Error | Status Code | Cause |
|---|---|---|
| ”Job description is required” | 400 | Missing jobDescription field |
| ”Either a resume file or ‘selfDescription’ is required” | 400 | No resume uploaded and no self-description provided |
| ”Unsupported resume file type” | 400 | File is neither PDF nor DOCX |
| ”Unable to read the uploaded resume” | 400 | Local parsing failed and no fallback available |
| ”Could not extract text from the resume file” | 400 | No text extracted and no alternative input provided |
Validation Logic
Frominterview.controller.js:16-29:
Best Practices
Use Text-Based PDFs
Use Text-Based PDFs
Text-based PDFs parse faster and more accurately than scanned images. Use tools like Adobe Acrobat or Word to export text-based PDFs.
Optimize File Size
Optimize File Size
Keep resume files under 2MB for faster upload and processing. Remove unnecessary images or compress the PDF.
Provide Both Resume and Self-Description
Provide Both Resume and Self-Description
While only one is required, providing both gives the AI more context to generate better interview reports:
- Resume: Structured work history and skills
- Self-description: Additional context, soft skills, and personal narrative
Use Standard Fonts
Use Standard Fonts
Stick to standard fonts (Arial, Times New Roman, Calibri) for better text extraction accuracy.
Next Steps
Generate Interview Reports
Learn how to generate comprehensive interview reports using your uploaded resume
API Reference
View the complete API documentation for the interview generation endpoint