Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing the workflows #8

Closed
wants to merge 4 commits into from
Closed

testing the workflows #8

wants to merge 4 commits into from

Conversation

sarinali
Copy link
Collaborator

@sarinali sarinali commented Oct 26, 2023

Added an Exception for illegal PDF uploads, serializes and encodes PDFs into bInary for mongodb storage. Currently storing a static pdf located in the local repository. Created new endpoint routes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentionally added?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this please

// 1 mb = 1024 * 1024

try (FileInputStream fileInputStream = new FileInputStream(pdfFile)) {
if (pdfFile.length() > 16 * 1024 * 1024) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make 16 * 1024 * 1024 a constant?
Eg.
MB_TO_BITS = 1024 * 1024
fileSizeLimit = 16 * MB_TO_BITS

}

@GetMapping("/checkFiles")
public void checkPDFS() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this used for?

DocumentRepository documentRepository;
@GetMapping("/upload")
public String uploadPDF () {
String currentDirectory = System.getProperty("user.dir");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding this endpoint should take in the pdf to be uploaded as a parameter to send it to the MongoDB, or are we getting hardcoded files from within the project?

@sarinali sarinali closed this Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants