I have a form that uploads a file and that is working fine. My user complains that every time they want to upload, they have to browse through their ugly directory structure to find the same file time and again. So I thought I'd be nice and capture the file name and write it to a cookie on their system when they hit the submit button, then when they return to the page later, I'd retrieve the info in the cookie and stuff it in the box where the file name goes. The cookie code is working - I have put several alert() stmts so I know I am saving and retrieving the file name OK. The problem is getting the file name into the filename box - how do I do that, or is it even possible?
Here's the code for the form:
In js, i have tried:
document.getElementById("userfile").value = savedFileName;
and
document.form1.filename.value = savedFileName;
with no luck.
Ideas/suggestions? Is this possible? Thanks in advance.
Here's the code for the form:
Code:
<form action="roster_upload01a.php" method="POST" enctype="multipart/form-data" name="form1" id="form1" onSubmit="validateForm(this.form);">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file:
<input id="userfile" name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
In js, i have tried:
document.getElementById("userfile").value = savedFileName;
and
document.form1.filename.value = savedFileName;
with no luck.
Ideas/suggestions? Is this possible? Thanks in advance.