-1

click here to download :

Download image

<a href="C:/Users/user/Desktop/Strectching.jpg" target="_blank" download="Stretching.jpg">Download image</a>

When I try download the file within the folder that the html code is found, it works perfectly. But when I specify a specific URL, then it does not work.

Shaam
  • 92
  • 13

2 Answers2

1

Try using File URI scheme.

Something like file://c/users/user/Desktop/Strectching.jpg

Im not sure for synthax now on Windows but it should be like i wrote below

Fr0zen
  • 21
  • 4
  • I tried using the File URI Scheme. When I open the image in firefox using the File URI scheme, it works. But when I insert it into the code, it does not work. – Shaam Feb 08 '15 at 10:52
  • 1
    Did you try following solution in this link : http://stackoverflow.com/questions/12711584/how-to-specify-a-local-file-within-html-using-the-file-scheme – Fr0zen Feb 08 '15 at 10:55
0
<a href="file:///C:/Users/user/Desktop/Strectching.jpg" target="_blank" download="Stretching.jpg">Download image</a>

It will open the file in a new tab and there you can download it. If the extension of the file is not familiar with the browser, it will prompt you whether to download it or open it with an application

Shaam
  • 92
  • 13