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

Allow API Gateway to pipe file data with correct name instead of uuid #59

Open
evanugarte opened this issue Nov 27, 2020 · 3 comments
Open
Assignees
Labels

Comments

@evanugarte
Copy link
Owner

On website/src/ApiFunctions/ApiHandler.js:26, we have to explicitly set the file name and make the handleDownload function take a parameter so we can download the file with the correct name. Instead, lets have the API gateway respond with the correct file name when taking in a uuid at the /download endpoint.

@evanugarte evanugarte self-assigned this Nov 27, 2020
@evanugarte
Copy link
Owner Author

@evanugarte
Copy link
Owner Author

Game Plan

  1. in lft::MongoDbHandler, add a function to find the name of a file given its id.
  2. In lft::HttpServer, change the LogDownload to instead return JSON with the following format:
{ "download_count": 10, "file_name": "idk.pdf" }
  1. With the new JSON response from the API, use the above comment's approach for piping the file name back to the frontend.

@evanugarte
Copy link
Owner Author

Use fs write streams? google search, stackoverflow, another fs example,

evanugarte added a commit that referenced this issue May 27, 2021
Part of #59. When we log a download, the logging service now returns a JSON
response containing the name of the file that was downloaded. This is so we can
supply the file name with the file data from the API gateway instead of manually
setting it in the frontend.
evanugarte added a commit that referenced this issue May 27, 2021
Part of #59. When we log a download, the logging service now returns a JSON
response containing the name of the file that was downloaded. This is so we can
supply the file name with the file data from the API gateway instead of manually
setting it in the frontend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant