File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes File Upload urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "File Upload urgent" Watch "File Upload urgent" New topic

File Upload urgent

Arul anandham

Joined: Jul 26, 2001
Posts: 4
I am using html FILE Tag . In This I want to give the file path directly not by selecting throw browser button.
How It cab be.
If Possible post sample code
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17276

response.setHeader("Pragma" , "no-cache");
response.setHeader("Cache-Control" , "no-cache");
response.setDateHeader("Expires" , 0);
response.setHeader("Content-Disposition" , "inline; " + "filename=\"MailingLists.rtf\"");
response.setHeader("Content-Description" ,
"Display database as RTF");
It's the Content-Disposition that does it. Depending on the browser, you can select in-the-browser viewing, automatic download (attachment) or other options.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: File Upload urgent
It's not a secret anymore!