Reply to Re: Checking File Size Before Upload

Your name:

Reply:


Posted by Schraalhans Keukenmeester on 12/17/62 11:56

Luke - eat.lemons@gmail.com wrote:
> Luke - eat.lemons@gmail.com wrote:
>> Chung Leong wrote:
>>> Andy Hassall wrote:
>>>> However, there's no way for PHP to send a response to the browser
>>>> yet, because
>>>> the content of the file is part of the HTTP request. Its choices are
>>>> to either
>>>> unceremoniously dump the connection without a response (which it
>>>> doesn't do,
>>>> for obvious reasons, although the HTTP protocol does allow this), or
>>>> wait until
>>>> the request has finished so it can send a response back with an
>>>> error message.
>>>>
>>>> AFAIK this is a limitation of the HTTP protocol and so cannot be
>>>> worked
>>>> around.
>>>
>>> I don't think the HTTP protocol specs mandates that a response can only
>>> be sent after the request body has been fully received. In theory, the
>>> server can send status code 100 to accept the request or a 4xx error
>>> code to reject it. That's not how it's implemented in the browsers
>>> though, AFAIK.
>>>
>>> The browser should pass the size of the request to onSubmit if you ask
>>> me. Sometimes I wish HTML hadn't just stopped progressing completely...
>>>
>>
>> Hi,
>>
>> try using a hidden max file size field to pass to php
>>
>> <input type="hidden" name="MAX_FILE_SIZE" value="2048576">
>>
>> Cheers,
>>
>> Luke.
>>
> Just found a reference to it. http://uk2.php.net/features.file-upload

Not sure if this holds truth in general but: on my host's
(Centos/Apache2.0.50/PHP4.3.4) server, using firefox as a browser (on
Gentoo) the MAX_FILE_SIZE field is not acknowledged by either the server
OR the browser. It simply sends the request regardless and than we're
back at OP's original issue.

I believe some choose a javascript solution to have the client check the
filesize. Not sure how (well) this works.

Sh

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация