This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Servlets and the fly likes fileupload- default file name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "fileupload- default file name" Watch "fileupload- default file name" New topic

fileupload- default file name

N SRao

Joined: Nov 13, 2001
Posts: 11
Hi I am using the com.oreilly.servlet.MultipartRequest for uploading the file, but I want to set the default file value in HTML, beacuse it is fixed file which I want to upload.How to do this ?I have tried like this but servlet is giving file as "null".
<INPUT TYPE=FILE NAME=file value="E:/mail/NewTest.class">
Please solve my problem.
Can any body help me?;
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

You need to send in the 'default' name as a hidden field.

Because the request object does not guarantee the order in which you can pull off the parameters, you'd need to upload the file to a temporary directory.

Then when you have the filename, use the Java file i/o classes to move/rename your file.
I agree. Here's the link:
subject: fileupload- default file name
Similar Threads
fileupload- default file name-ujent help
File Uploading Problem !!
File Uploading Problem !!!
using field value
upload file to client computer