• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File upload using html:file

 
Rafael Andrade
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic