File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes How do i add a link for download? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How do i add a link for download?" Watch "How do i add a link for download?" New topic
Author

How do i add a link for download?

Ravi Seth
Greenhorn

Joined: Apr 30, 2013
Posts: 5
I am trying to download a file using <a href="link"> </a> format.. however its saying file not found, even though the link is correct. I am using java jsp for downloading the file. Please help
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

Welcome to the ranch Ravi. :) Please show us what you have written so far in your JSP. Use code tags to paste code.


~ Mansukh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61611
    
  67

If you are getting a 404 then the link is not correct. Please show us the code that is showing the problem, and describe where the file being downloaded is stored within your web application,


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ravi Seth
Greenhorn

Joined: Apr 30, 2013
Posts: 5
Bear Bibeault wrote:If you are getting a 404 then the link is not correct. Please show us the code that is showing the problem, and describe where the file being downloaded is stored within your web application,



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61611
    
  67

I asked for the code that's showing the problem; not the whole page. That's way too much code to wade through to find one issue. And scriptlets in a JSP! :shock:
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18886
    
    8

And the code isn't very useful either, because we can't tell what the link is that it's generating.

You, on the other hand, can tell that by viewing the generated HTML in the browser. Or by hovering the cursor over the link you have a question about to see what URL it's actually going to connect to. So I suggest that you do so. Find out what the URL is and compare to what you expected it to be. Post details about that if you have a further question.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18886
    
    8

By the way I don't see any <a href=anything> in your code either.
 
jQuery in Action, 2nd edition
 
subject: How do i add a link for download?