You are here: Re: Checking File Size Before Upload « PHP Programming Language « IT news, forums, messages
Re: Checking File Size Before Upload

Posted by Luke - eat.lemons@gmail.com on 08/23/06 09:49

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

 

Navigation:

[Reply to this 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

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