Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

fileupload- default file name

 
N SRao
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic