Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pre-selected File Upload

Status
Not open for further replies.

MrMerlotti

Technical User
Aug 6, 2005
32
GB
I need to upload a name file to the webserver each time. It seems it's not possible to pre-set the value when using Enctype="multipart/form data".

Has anybody ever come across a solution to this where the user doesn't have to browse for the file name?

 
I could be wrong, but I don't think security settings would allow you to arbitrarily pick a file from a user's machine and upload it to your server.

Since you can hide forms and auto-submit data without user interaction, imagine going to a website that tries to pick a file from your machine and download it...

I am pretty sure that the user has to select the file, thereby "attaching" it to the form in order for an upload to work.

You might be able to do it with some sort of ActiveX control, as you need the user's permission to install that, but any other way is not doable (me thinks)

TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top