Home > Enterprise >  How to make an apk file downloadable from a react js website
How to make an apk file downloadable from a react js website

Time:03-13

I am having an apk file stored in a folder of my react js project src/asset/myapp.apk, I want to make it downloadable from my portfolio website. How can I achieve that?

CodePudding user response:

Try putting your static files in public/ folder.
Then simply retrieve it by addressing "/path/to/file.apk" When using src/ filename will be processed and changed relative to your webpack config which can vary each time you run a build which is not a good practice.

If you're using create-react-app read this documentation: Using the Public Folder

Note: if you are using gatsby, please use static/ folder instead of public.

  • Related