This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Download CSV file from apllication server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Download CSV file from apllication server" Watch "Download CSV file from apllication server" New topic
Author

Download CSV file from apllication server

felix thomas
Ranch Hand

Joined: Jun 10, 2001
Posts: 89
Hi,

I have created a csv file in the weapps/csv directory. now my problem is i want to download that csv file from a jsp page by giving a link.

i don't want to hard code the server path , is there anyway i can do that

the application server i am using is tomcat. Just by clicking the link the csv file shd download
Amol Fuke
Ranch Hand

Joined: Apr 08, 2005
Posts: 129
You can use the properties file for this.
Read the property with help of ResourceBundle from the file and use it to make the link.

If your server changes you just need to change value of that variable in the property file.


"There are no mistakes, only lessons"
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
Tomcat will not serve files that are inside the WEB-INF directory, so you will need to create the file somewhere outside of it in a publicly accessible directory, or write a download servlet that reads the file in WEB-INF and streams it to the client for you.


Ping & DNS - my free Android networking tools app
 
Consider Paul's rocket mass heater.
 
subject: Download CSV file from apllication server
 
Similar Threads
file downloading from the server
generate zip file containing a csv file
is it MIME types?
Important
Force file download