Hi all,
I have a problem that is download static file does not work after deploying react app with aws-amplify, the size of downloaded file is very small in comparison with actual file. This code works perfectly on localhost. I don't really know what is problem. Can anyone experience this problem like me?
I placed files that I need to download in the public folder
Please see below is my code
Thanks all!
@nhhaidee can you provide an appId? Is the download triggered by just clicking a link?
The link provided doesn't work https://github.com/aws-amplify/amplify-console/issues/asset/files/VolunteerApplicationForm_v1.pdf
How can I get appID? I copied my code into comments but not sure why it became https://github.com/aws-amplify/amplify-console/issues/asset/files/VolunteerApplicationForm_v1.pdf
After I deploying with amplify the link is https://www.
There is no problem with localhost: https://localhost:3000/asset/files/VolunteerApplicationForm_v1.pdf
Can you help me on this problem? Thanks
I have found the root cause of the problem: in the Rewrites and redirects Rule of my app missing pdf file extension, so I added pdf into source and it works fine.
{
"source": "^[^.]+$|\.(?!(css|pdf|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>",
"target": "/index.html",
"status": "200",
"condition": null
}
Most helpful comment
I have found the root cause of the problem: in the Rewrites and redirects Rule of my app missing pdf file extension, so I added pdf into source and it works fine.
{
"source": "^[^.]+$|\.(?!(css|pdf|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>",
"target": "/index.html",
"status": "200",
"condition": null
}