Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Vancouver
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to set value when use <input name="File1" type="File" value="?"

    Hi, I'm trying to create a page to upload files automatically. This is my code:

    <form name="frmUpload" action="upload.asp" method="post" enctype="multipart/form-data">
    <input type="file" name="file1" value="<%=FilePath%>">
    </form>
    <script language="Javascript">
    document.frmUpload.submit();
    </script>

    The problem is:
    the "value" property is read only, the value couldn't be set unless user click "Browse" button and choose a file. Is there any way can change the value by coding. Thanks

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Only with trusted script in Netscape (4+) - not at all in MSIE. If you could, you could remotely select a user's files and upload them programmatically - so much for privacy.


  •  

    Posting Permissions

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