Skip to content

More robust storage of resumes #45

@Struck713

Description

@Struck713

Instead of passing a Base64 string around, create an Express route where we can upload (and later request for viewing) resumes

RemoteProcedures.setUserResume = async (userID, base64resume, resumeFilename) => {
resumeFilename = path.parse(resumeFilename).base; // make sure this isn't a path
const userResumePath = getUserResumePath(userID);
if (!existsSync(userResumePath)) {
await fs.mkdir(userResumePath, {recursive: true});
} else {
const files = await fs.readdir(userResumePath);
await Promise.all(
files.map((f) => fs.unlink(path.resolve(userResumePath, f)))
);
}
if (base64resume){
const userResumeFilePath = path.join(userResumePath, resumeFilename || "untitled.pdf");
const bufferData = Buffer.from(base64resume, 'base64');
await fs.writeFile(userResumeFilePath, bufferData);
}
};
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions