Perhaps I'm misreading the question [skimmed it], but I don't believe you can modify a file upload box with javascript. If so then what's stopping the site from uploading _any_ file on your PC?
You can certainly do this for any other form element, but for file uploads I've always had to use the standard.
Code:
<input type="file" name="foo">
Note, the form must POST and must contain
enctype="multipart/form-data" in the form definition.
-r