0

I am trying to open a file through a jsp page. The file is in a specified location in my server. I have used the below piece of code.
- This code is working in my local and not when I run it through my localhost in Tomcat server. In the server, it is only working if the copy the file to the current directory.
- This works only in Chrome

Can someone help. Thanks.

<!DOCTYPE html>
<html>

<head>
</head
<body>

<a href="W:\New folder\18090Calendar.png" download="18090Calendar.png" target="_new-tab">Image</a>

<body>
</html>
Prmk
  • 175
  • 2
  • 2
  • 13

1 Answers1

1

You shall configure proper mime type for files that you want to be served as downloadable things on your web server. Like "application/force-download" or so.

Check here: How to force browser to download file?

Community
  • 1
  • 1
c-smile
  • 26,734
  • 7
  • 59
  • 86