setting value of control type "file"

Results 1 to 2 of 2

Thread: setting value of control type "file"

  1. #1
    Join Date
    Dec 1969

    Default setting value of control type "file"

    Hi and thanks<BR>I can read but not set the value of a control<BR>function myFile_onchange()<BR>{<BR> alert(document.form1.myFile.value); // no problem<BR> document.form1.myFile.value="change it to this"; // no go<BR>}<BR>:::::::::<BR>&#060;form name="form1"&#062;<BR>&#060;input type="file" name="myFile" onchange="return myFile_onchange()"&#062;<BR>&#060;/form&#062;<BR><BR>What am I missing here?<BR>I&#039;m using IE6<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: setting value of control type

    You&#039;re missing security considerations....<BR><BR>If you were allowed to change the value of a type=file &#060;input&#062; malicious website operators could easily steal any file on your system. All they would have to do is get the file that holds your windows password, submit the form to a server-side script that accessed your IP and the user could be easily hacked in many cases.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts