I have already found the solution to this issue and it is included in this post. This is just to alert anyone who is suffering through the same issue.
The Problem: I was trying to get a PDF to download in my react app. This is the embedded code for the download:
import ResumePDF from "../../files/Resume.pdf";
// somewhere in a react functional component...
<a href={ResumePDF} target="_blank" rel="noreferrer" download="zolyomi_resume.pdf">
<Button>download</Button>
</a>
Now, I verified that the file was in the correct location and was being imported properly. Indeed, when I ran this locally, it had no issues whatsoever. The problem came when I deployed to AWS Amplify (committed to the linked github repo).
The Solution: In AWS Amplify, there is a specific portion of the App Settings where you specify that certain file types are linked to certain extensions.
Basically, you have to specify that the .pdf file is a valid form of redirectable file.
- Head to your AWS Amplify console
- Navigate to the app having the issue
- Select Rewrites and Redirects from the left sidebar
- Edit the rewrite that looks like a long Regex string. The pdf extension is not included in this list by default, so you have to add it. After the word
css(or any other file extension) add the following:|pdf. Make sure that you keep this as arewriteand not aredirect. It should look like this:
- Save, ensure it updates in the console, and then refresh the page. It should work now.
TL;DR Amazon Amplify makes you specify file types that are redirectable. By default, PDF is not. Other file types besides css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json are not either, so you have to add them in yourself.



