-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentionally added?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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?
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.