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
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: 16539

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.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: File Upload urgent