This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes Accessing Files From Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Accessing Files From Servlets" Watch "Accessing Files From Servlets" New topic
Author

Accessing Files From Servlets

abhijit salvithal
Greenhorn

Joined: May 19, 2005
Posts: 7
hi all,


I have a problem. When try to create file instance form File(URI) constructor of file.
I m creating URI by passing string url to URI like http://localhost:8080/testApp/myFile.txt
when i type this on browser i can see the file but i not able to access via File by passing the same uri.

Thanks in Advance & Regards,
Abhijit
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Abhijit,

Can you tell us what you mean by "access" the file?
Are you trying to download it?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing Files From Servlets
 
Similar Threads
Why can't we access resources using URL, inside the WEB-INF or META-INF folders
How can I map the root of servlet and send down a static page
UrlRewrite Rule works on tomcat 4.1.34 but fails on tomcat 5.0.28
tomcat problem
open a file on a button click event in a JSP