Closed YuanTian1991 closed 3 years ago
:heavy_check_mark: Deploy preview for phenopolis-dev ready!
:hammer: Explore the source changes: 57e4322a6fd730f71221a1e70245f5c36ddeba63
:mag: Inspect the deploy logs: https://app.netlify.com/sites/phenopolis-dev/deploys/5ff7a4aa95bbe90007707788
:sunglasses: Browse the preview: https://deploy-preview-308--phenopolis-dev.netlify.app
I think POST is fine :)
PS in flask, if the param contains a slash, you can use the path converter - i.e.
"/file_download/<path:file_key>"
(see here
@YuanTian1991 - there is a bug: TypeError: Cannot read property 'Contents' of undefined
That's weird!
I previous indeed found the return of this API is slight differen on dev and localhost, but I did not think much, thought push and merge code should solve it. But this inconsistent still exist.
I think we can try restart the server a bit? Previously it's definitely running well on my computer.
Hey, yep - just did a manual deploy - and that seem to have fixed things :)
(Will need to look into why the automated deploy is not always working for us when I get a chance)
It works now, file can be downloaded.
I did not change the backend API for download from "POST" to "GET", merely because the fileKey format is:
So if we use "GET" method, like:
The server would not go to API "download", instead if went to "download/PH0000XXXX/". But it's still possible to use "GET", then the fileKey must be send by param, like a string. I can change that if needed, I just think there is less difference between "GET" and "POST" here.