Amplify-console: Download static file does not work after deploying react app with aws-amplify

Created on 12 Nov 2020  路  3Comments  路  Source: aws-amplify/amplify-console

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

Volunteer Application Form

Thanks all!

question

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": "",
"target": "/index.html",
"status": "200",
"condition": null
}

All 3 comments

@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./asset/files/VolunteerApplicationForm_v1.pdf, I used a tag to implement download this file, but when I click and download it, the actual file size ie very small, I guess there is something with building on Aws-amplify.

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": "",
"target": "/index.html",
"status": "200",
"condition": null
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adamaltman picture adamaltman  路  3Comments

ckamps picture ckamps  路  3Comments

hassankhan picture hassankhan  路  4Comments

AustinZhu picture AustinZhu  路  4Comments

nomiddlename picture nomiddlename  路  4Comments