To the best of my knowlege, there is no way to preload the value of a file 
input field or to programmatically load it. 

I've tried with Mozilla and it throws a javascript security exception. (I 
haven't tried with MSIE).

To do so would be a security threat.  Any webpage could have a hidden form 
that looks for a particular file (or set of files) and submits itself as soon 
as the page loads.  The user would have no way of stopping it or even knowing 
that it's going ont.










On Thursday 24 July 2003 05:51 pm, you wrote:
> Can anyone tells me how to modify my form to ensure that the contents of an
> <input type="file"> control are still present when I return to the form?
>
> My file upload servlet is working pretty well now except for one thing. I
> am doing edits on each of the files which are to be uploaded, including a
> check to see if the file is larger than an individual size threshold I have
> set. (This is something I've created myself because I want an individual
> size limit, not the aggregate limit provided by the Commons FileUpload
> team.) When an individual file size is too large, I create a message and
> display it, then invite my user to press the back button on their browser
> to go back to the form to modify the form - either replace the name of the
> overly large file with a smaller one or blank it out altogether.
>
> Everything works fine except that when the user gets back to the form, all
> of the fields that are <input type=file> are blank. The <input type=text>
> fields retain their original values. I would like the <input type=file>
> controls to also contain their original value. What do I need to do to make
> that happen?
>
> I've never seen this "blanking" behaviour in other forms but this is the
> first time I've written a servlet containing an <input type=file>
> control....
>
> I am running Tomcat 4.1.24. My browser is IE 6.0.2800.xpsp2.030422-1633. My
> OS is Windows XP Pro with all critical service applied.
>
>
> Rhino
> ---
> rhino1 AT sympatico DOT ca
> "If you want the best seat in the house, you'll have to move the cat."

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to