File Size problems when uploading via PHP and Apache
| From: | Yadda Yadda | Date: | Fri, 07 Jul 2000 17:47:51 +0000 |
| Subject: | File Size problems when uploading via PHP and Apache | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5421@lists.php.net to get a copy of this message | ||
Hi,
I'm using a PHP3 script on Apache on a Debian Linux server to upload files via a web page.
The page works fine for files up to about 1.9 MB in size (maybe 2.0 MB), but anything larger than that and I get the following error:
Warning: Unable to open 'none' for reading: No such file or directory in /home/httpd/www/_private/sucker/index.php3 on line 40
It sort of looks like the file isn't being copied to the /tmp directory on the server, so my script can't then copy it to where I want it to finally wind up.
I thought maybe Apache was timing out, so I boosted the timeout to 900 seconds. Didn't work.
Any ideas as to why this is failing would be most appreciated.
John Nolt
Here's the script (most of it, anyway):
<FORM ACTION="index.php3"
METHOD=POST
ENCTYPE="multipart/form-data">
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td>Upload this file: <INPUT TYPE=FILE NAME=userfile></td>
<td><input type="submit" value="Send that Sucker!" name="B1"></td>
</table>
</form>
<?
if($userfile){
if (copy($userfile,"incoming/$userfile_name")) {
echo("<B>File successfully uploaded!</B><P>");
} else {
die("<B>Error: failed to copy file.</B>");
}
unlink($userfile);
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com