Check out example codes for "html download image". It will help you in understanding the concepts better.

Code Example 1

<a href="/images/myw3schoolsimage.jpg" download>

Code Example 2

<a href="the/name/of/your/file.x" download>

Learn ReactJs, React Native from akashmittal.com