wood burning stoves 2.0*
The moose likes Struts and the fly likes File upload using html:file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "File upload using html:file" Watch "File upload using html:file" New topic
Author

File upload using html:file

Rafael Andrade
Greenhorn

Joined: Aug 04, 2006
Posts: 15
Hello!
I�m uploading a file to the database, and it works ok. I click on it, select the file, and the path is on the text area. But when I get the record, the text area is blank. How can I put the name of the file there?

in the jsp:
<html:file property="${nameForm.map.name}[${lineNumber-1}].formFile" styleClass="text" size="35"/>

thanks!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
While the HTML 4.0.1 specification says that a browser "may" display a default value in a file upload control, neither Internet Explorer nor Firefox will do so.

It's considered a security risk. Think about it: If a malevolent website wanted to upload information from your computer, all they'd have to do is set a default for say, your outlook address file, and then use JavaScript to submit the form automatically. As far as I know, there's no way to set a default upload file.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File upload using html:file