Jump to content

John McKean

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by John McKean

  1. In my limited experience, the HTML upload goes to a tmp directory on the server and the CGI script can then look at the size. (As long as it's smaller than MAX_FILE_SIZE.)I'm not aware of anything that can detect the size before an upload.If there is, I'd love to hear about it!
  2. Newbie - please forgive my ignorance.I have an upload form and I want to put a default value in the filename input.Since file inputs have no associated value="xx" method, I tried the following JavaScript using the DOM defaultValue property. I added a text input (test1) to verify that the script is executed. IE-6 correctly puts "abc" in the test1 box, but doesn't modify the file box or pass the defaultValue ("c:\test1.txt") to my PHP CGI file.Mozilla 1.7.8 doesn't appear to do anything at all.Is there something wrong with my approach or another method that would work?Thanks,John <html><head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <meta http-equiv="PRAGMA" content="NO-CACHE"><title>Upload</title><script type="text/javascript">function setDefaults(){document.getElementById("test1").value="abc"document.getElementById("userfile").defaultValue="c:\test1.txt"}</script></head><body onload="setDefaults()"><form enctype="multipart/form-data" action="test_upload.php" method="post"><input type="hidden" name="MAX_FILE_SIZE" value="1000000"><input name="test1" type="text">File to send: <input name="userfile" type="file" size="50"><br><br><input type="submit" value="Send File"></form></body></html>
×
×
  • Create New...