Re: HTML Form with method="POST" and enctype="multipart/form-data" is not working for passing data to the web server.
| From: | Richard Davey | Date: | Wed, 10 Dec 2003 17:25:31 +0000 |
| Subject: | Re: HTML Form with method="POST" and enctype="multipart/form-data" is not working for passing data to the web server. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172361@lists.php.net to get a copy of this message | ||
Hello prashant,
Wednesday, December 10, 2003, 5:20:18 PM, you wrote:
p> <form name="frm1" method="POST" action="test1.php3"
p> enctype="multipart/form-data">
p> <input type="text" name=text1 value="">
p> <input type=file name=file1>
p> <input type=submit name=btnsubmit value="Submit">
p> </form>
You should have set the max_file_size here, but it's not included.
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
This must come BEFORE the input type=file and remember the value is in
bytes (not KB), so the above will only let you upload a file of
approx. 1KB.
p> <?
p> echo $text1;
p> echo $file1;
p> echo $file1_name;
p> copy($file1,"d:\prashant\$file1");
?>>
I don't know how your register globals are set, but you *really* ought to
be getting these values from the $_FILES array:
$file1_name = $_FILES['file1']['name']
etc
See Chapter 18 of the PHP manual.
p> Unable to open '' for reading: No such file or directory in
p> /home/httpd/html/fai/test1.php3 on line 12
Yeah, you can't copy "nothing" :)
--
Best regards,
Richard mailto:rich@launchcode.co.uk