Re: File upload problem
| From: | David Rice | Date: | Sun, 09 Feb 2003 22:14:07 +0000 |
| Subject: | Re: File upload problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134985@lists.php.net to get a copy of this message | ||
Hi John:
Well actually I believe that you don't have to set MAX_FILE_SIZE...(I don't)
but you might want make sure that you are not trying to send a file larger than the post_max_size directives in php.ini and ensure that file_uploads is set to allow http uploads.
On Sunday, February 9, 2003, at 04:56 PM, Gurhan Ozen wrote:
Hi, You need to specifye the MAX_FILE_SIZE value as a hidden argument to the form.. See: http://www.php.net/manual/en/features.file-upload.php Gurhan On Mon, 2003-06-30 at 15:05, John M wrote:Hello, I have the code below. It's a simple file upload. But it doesn't work. Before the line if(isset( $Submit )) is an echo which can I read. But after choosing a file and press a submit nothing happens. Why is if(isset( $Submit )) always false? Maybe my apache or php config is wrong? I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir is "c:\tmp\" and upload_max_filesize is 2M in PHP config file. Thanks! <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form name="form1" method="post" action="" enctype="multipart/form-data"> <input type="file" name="imagefile"> <input type="submit" name="Submit" value="Submit"> <? echo "Before submit <br>\n"; if(isset( $Submit )) {-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpecho "After submit <br>\n";if ($_FILES['imagefile']['type'] == "image/gif"){ copy ($_FILES['imagefile']['tmp_name'],"files/".$_FILES['imagefile']['name'])or die ("Could not copy"); echo "Name: ".$_FILES['imagefile']['name']."";}else { echo ""; echo "Could Not Copy, Wrong Filetype(".$_FILES['imagefile']['name'].")";}} ?> </form> </body> </html> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php