0

I have a project which requires me to upload an excel file , manipulate it and then give the option to download the modified file.

I have successfully uploaded the file on my local machine but after manipulating and giving the option to download by <a href="/home/aman/projetc/a.xls" download="a.jsp">Download</a> the download says "No file found" . How can i make this file available to the project ? `

tereško
  • 58,060
  • 25
  • 98
  • 150
Evan Root
  • 279
  • 1
  • 5
  • 19

1 Answers1

0

The path "/home/aman/..." (a unix user directory) is not accessible from the net (or at least I hope so). You can create a different directory to store your downloads, maybe "/var/downloads", give Tomcat rights to read it, and add an external context to your server.xml (between the "host" element):

<host ...>
  <Context docBase="/var/downloads" path="/downloads" />
</host>

Then you should be able to access:

http://yourdomain.org/downloads/a.xls

Stefan
  • 12,108
  • 5
  • 47
  • 66
  • Thanks , as i am very new to this i just though that writing Download willl do the job but one needs to create a servlet as well that will download the file . I just assumed that the former statement would magically download it for me which it wouldn't . So that was the problem . Thanks for the help . – Evan Root Apr 07 '16 at 10:17