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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

input type=file?!?!?! 2

Status
Not open for further replies.

NiteCrawlr

Programmer
Mar 16, 2001
140
BR
Hi, :)
Is there a way I could set a value of an <input type=file name=file1>???

I´ve tried to put value=something..... but it didn´t work

I want a value to appear in the field, so I don´t need to click on Browser and choose a file......

Thanks in advance

NiteCrawlr
 
But you'll need the whole path as it is on the user's machine, will you know that? I think that's why it's not done (using a value in a file field), because you wouldn't know what their drive letter is for sure, or where their file is in the directory structure.

You could always write the text below the input box, &quot;For example, C:\mydir\myfile.txt&quot; or something.
 
I have tried everthing. You can't associate a value to input type file. DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Here's an interesting blurp from an article I recently read. This may provide some more light on the issue.


The use of the VALUE clause is interesting. Normally, it is intuitive to let the web site preset values of form fields for user convenience. However in this case, it could allow a nefarious web site to preset the name of the file to uploaded, and coupled with a client-side form submit, &quot;steal&quot; files off a user's PC without their consent. In the summer of 1997, the CERT in conjunction with an employee at Bell Labs, issued a security warning about this, and both Netscape and Microsoft quickly issued patches that prevent presetting the file be uploaded (see:
This is unfortunate, since the original RFC1867 clearly specified &quot;it is important that a user agent not send any file that the user has not explicitly asked to be sent.&quot; So rather than disabling presetting the name entirely, the browser vendors could have simply issued an alert dialog box such as : &quot;Are you want to transmit files x, y, z to the server?&quot;. As a final twist to this, yet another security hole was found in IE 4.01 in mid-October that allows a web site to circumvent IE's current security mechanism (see


You can read the entire article pertaining to file uploading at
Interesting ??

TW
 
VERY interesting! Thanks Todd. BTW, I agree that the solution of disabling setting a default value for a file upload control was not the best choice. It was the lazy solution, plain and simple. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top