Re: File Upload
| From: | Edward Marczak | Date: | Thu, 30 May 2002 14:21:28 +0000 |
| Subject: | Re: File Upload | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99918@lists.php.net to get a copy of this message | ||
On 5/30/02 8:13 AM, "Ford, Mike [LSS]" M.Ford@lmu.ac.uk
pressed the keys forming the message:
>> -----Original Message-----
>> From: Edward Marczak [mailto:marczak@usa.net]
>> Sent: 30 May 2002 03:27
>>
>> OK - I've read the manual, looked at sample code....and I sadly am
>> missing something.
>>
>> I'm doing (basically) this in my form:
>>
>> <form action="someform.php" ENCTYPE="multipart/form-data"
>> method="post"
>> name="replysub" id="replysub">
>> <input type="hidden" name="MAX_FILE_SIZE"
>> value="100000">
>> <input type="file" name="subfile" id="subfile"
>> size="50">
>>
>> On the page it's submitted to, just to check the data, I did this:
>>
>> $lineNo = 1;
>> echo "Dumping file info...<br>--------------------------<br>";
>> reset($_FILES);
>> while (list ($key, $val) = each($_FILES['subfile'])) {
>> echo "$lineNo $key => $val<br>";
>> $lineNo++;
>> }
>>
>> ....and I get this:
>>
>> Dumping file info...
>> --------------------------
>> 1 name => somefile.exe
>> 2 type => application/x-msdownload
>> 3 tmp_name => none
>> 4 size => 0
>>
>> Where do I start looking to figure out why tmp_name and size
>> don't get
>> set? Why doesn't this file get uploaded?
>
> tmp_name and size *are* set -- "none" is PHP's way of saying it didn't
> actually upload anything, and "0" is the correct size for a file that wasn't
> uploaded anyway!
>
> At a guess, you've exceeded one of the size limits -- check the settings of
> the php.ini parameters upload_max_file_size and post_max_size (which should be
> larger than upload_max_filesize). And, just for good measure, check that
> file_uploads is turned On!
Hmmmmmm. Sure, file_uploads is on....and I just tested with a really small
file...and....yup. Looks like I'm going over some limit. Crap, I thought I
had that nailed down. Thanks - back to the manual for me.
--
Ed Marczak
marczak@usa.net