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

feat: Create new API for uploading papers #1932

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gzurowski
Copy link
Member

@gzurowski gzurowski commented Oct 22, 2024

Create a new API (/paper/upload) for creating pre-signed URLs, so that the caller can upload papers directly to S3. This will be the first step when submitting new papers to RH.

Closes ResearchHub/issues#131

@gzurowski gzurowski requested a review from a team as a code owner October 22, 2024 12:04
Copy link

sonarcloud bot commented Oct 22, 2024

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.10%. Comparing base (bc65ccf) to head (6b21892).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1932      +/-   ##
==========================================
+ Coverage   64.05%   64.10%   +0.05%     
==========================================
  Files         409      412       +3     
  Lines       23579    23612      +33     
==========================================
+ Hits        15104    15137      +33     
  Misses       8475     8475              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@yattias yattias left a comment

Choose a reason for hiding this comment

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

Looks good. How would the client use this presigned url?

@gzurowski
Copy link
Member Author

Looks good. How would the client use this presigned url?

The client sends a PUT request to the presigned URL with the payload of the file in the message body. This follows the existing implementation in the frontend: https://github.com/ResearchHub/researchhub-web/blob/aa00c1992b156f0ab89458643878c15ff788b5ab/components/ReferenceManager/references/api/postUploadPDFFiles.ts#L49.

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.

Create API for uploading papers to S3
2 participants