Thank you, all who replied. This helps me understand. I might give a
try to the workarounds some suggested.
Great newsgroup.
Jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
brian wrote:
Jeff Cohan wrote:
It seems that the server had to know the size of the file in order
to know it exceeded MAX_FILE_SIZE. So how can my script find out the
size?
Not at all. The user-agent is built to ignore files that exceed the
MAX_FILE_SIZE value.
Ack! I meant, "The user-age
Jeff Cohan wrote:
Dan Parry wrote:
I might be wrong but this would be classed as
'exploitable'... Webservers should not be allowed
to read from or write to clients... Of course there
is ActiveX...
I think we're off the point.
My script is simply interrogating the value of the
$_FILES[use
Ray wrote:
On Saturday 22 September 2007 7:39:01 pm Dan Parry wrote:
This would be the exploitable 'feature' I mentioned... Client-side files
should never be readable
Dan
If the contents of a file were readable, I would definitely agree with you.
I'm not convinced that the ability to det
Jeff Cohan wrote:
Dan Parry wrote:
I might be wrong but this would be classed as
'exploitable'... Webservers should not be allowed
to read from or write to clients... Of course there
is ActiveX...
I think we're off the point.
My script is simply interrogating the value of the
$_FILES[userf
On Saturday 22 September 2007 7:39:01 pm Dan Parry wrote:
> > -Original Message-
> > From: Ray [mailto:[EMAIL PROTECTED]
> > Sent: 23 September 2007 02:25
> > To: php-general@lists.php.net
> > Subject: Re: [PHP] MAX_FILE_SIZE not working with file uploads
&g
> -Original Message-
> From: Ray [mailto:[EMAIL PROTECTED]
> Sent: 23 September 2007 02:25
> To: php-general@lists.php.net
> Subject: Re: [PHP] MAX_FILE_SIZE not working with file uploads
>
> On Saturday 22 September 2007 7:44:55 pm Jeff Cohan wrote:
> > Dan Pa
On Saturday 22 September 2007 7:44:55 pm Jeff Cohan wrote:
> Dan Parry wrote:
> > I might be wrong but this would be classed as
> > 'exploitable'... Webservers should not be allowed
> > to read from or write to clients... Of course there
> > is ActiveX...
>
> I think we're off the point.
>
> My scr
> -Original Message-
> From: Jeff Cohan [mailto:[EMAIL PROTECTED]
> Sent: 23 September 2007 02:45
> To: php-general@lists.php.net
> Subject: Re: [PHP] MAX_FILE_SIZE not working with file uploads
>
>
>
> Dan Parry wrote:
> > I might be wrong but this wou
Dan Parry wrote:
> I might be wrong but this would be classed as
> 'exploitable'... Webservers should not be allowed
> to read from or write to clients... Of course there
> is ActiveX...
I think we're off the point.
My script is simply interrogating the value of the
$_FILES[userfile][size] a
> -Original Message-
> From: Jeff Cohan [mailto:[EMAIL PROTECTED]
> Sent: 23 September 2007 00:02
> To: php-general@lists.php.net
> Subject: Re: [PHP] MAX_FILE_SIZE not working with file uploads
>
> Chris wrote:
> > [error] => 2
> > And also gives you
Chris wrote:
> [error] => 2
> And also gives you an error code.
Yes, I know and knew that. That's why the upload ultimately fails
(which is okay).
My point is that when a file's size exceeds the MAX_FILE_SIZE value,
I want the browser to (a) detect that it's too large BEFORE
attempting to upload
And here is the dump of the $_FILES array (which, notably, reports
zero as the size):
[error] => 2
And also gives you an error code.
http://www.php.net/manual/en/features.file-upload.errors.php
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General Mailin
Max file size is a hint to the browser and not all support it...you can't count
on it
bastien
> To: php-general@lists.php.net> Date: Thu, 20 Sep 2007 14:45:36 -0500> From:
> [EMAIL PROTECTED]> Subject: [PHP] MAX_FILE_SIZE not working with file
> uploads> > Th
In the To: php-general@lists.php.net> Date: Thu, 20 Sep 2007 14:45:36 -0500>
From: [EMAIL PROTECTED]> Subject: [PHP] MAX_FILE_SIZE not working with file
uploads>> The punchline question is: What am I missing?>> Now for the
details.>> I have a form through which a u
In the
_
More photos; more messages; more whatever – Get MORE with Windows Live™
Hotmail®. NOW with 5GB storage.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_5G_0907
--
PHP General Mailing Li
The punchline question is: What am I missing?
Now for the details.
I have a form through which a user uploads image files. In the event
the chosen file exceeds the MAX_FILE_SIZE (which I have included as
a hidden form field immediately after the form tag), I want to abort
the upload process and d
On Tue, July 12, 2005 11:10 am, Chris said:
> The manual seems to imply that using MAX_FILE_SIZE will enable the
> browser to recognize the fact that a user is trying to upload a file
> that is too large and will, therefore, be able to give the user a
> warning to prevent the uploading of a file th
André Medeiros wrote:
On Tue, 2005-07-12 at 12:38 -0400, John Nichel wrote:
Sebastian wrote:
it doesnt seem to work on IE or Firefox.. two of the most popular
browsers..
this shoudn't even be in the manual then because if it doesnt work for
these two browsers then i would consider it
On Tue, 2005-07-12 at 12:38 -0400, John Nichel wrote:
> Sebastian wrote:
>
> > it doesnt seem to work on IE or Firefox.. two of the most popular
> > browsers..
> > this shoudn't even be in the manual then because if it doesnt work for
> > these two browsers then i would consider it pointless to
Sebastian wrote:
it doesnt seem to work on IE or Firefox.. two of the most popular
browsers..
this shoudn't even be in the manual then because if it doesnt work for
these two browsers then i would consider it pointless to use.
It may not be your browser that it's not working with...it may be
Ahmed Saad wrote:
hi Sebastain,
On 7/12/05, Sebastian <[EMAIL PROTECTED]> wrote:
yet it waits for file to upload before error.
I've been using php for serveral years and i cant remember ever getting
this to work like the manual states.
Quoting the *php manual*
"The MAX_FILE_SIZE hid
On Tue, 2005-07-12 at 11:35 -0400, Sebastian wrote:
> Each time i try setting MAX_FILE_SIZE in a form and using the upload
> error code to check if the file is large it always uploads the entire
> file before showing the error that the file is too big.. either the
> manual is incorrect or this d
Sebastian wrote:
Each time i try setting MAX_FILE_SIZE in a form and using the upload
error code to check if the file is large it always uploads the entire
file before showing the error that the file is too big.. either the
manual is incorrect or this does not work as every method i've tried
Each time i try setting MAX_FILE_SIZE in a form and using the upload
error code to check if the file is large it always uploads the entire
file before showing the error that the file is too big.. either the
manual is incorrect or this does not work as every method i've tried
always waits for th
On Saturday 31 July 2004 04:40, Monty wrote:
> If the MAX_FILE_SIZE form variable doesn't prevent this, as the manual says
> it should, then what's the point of using it?
It's up to the browser whether or not it uses that setting, most don't.
--
Jason Wong -> Gremlins Associates -> www.gremlins
This is what is says in the online php manual:
... You should add the MAX_FILE_SIZE form variable anyway as it saves users
the trouble of waiting for a big file being transferred only to find that it
was too big and the transfer actually failed.
... The MAX_FILE_SIZE hidden field must precede the
the problem with doing it on your server (you do it just to be sure though)
is that the user has to wait for the form + file to be sent to your server
before you can respond - this can be very slow
""JFL"" <[EMAIL PROTECTED]> wrote in message
9davlf$s63$[EMAIL PROTECTED]">news:9davlf$s63$[EMAIL
Thanks :)
--
[ www.eksperten.dk ] Scandinavias biggest IT forum.
""James Holloway"" <[EMAIL PROTECTED]> wrote in message
9db61u$7d9$[EMAIL PROTECTED]">news:9db61u$7d9$[EMAIL PROTECTED]...
> Jacob,
>
> When you upload a file, it appends a few of its own variables. One of
them
> is size - assuming
Jacob,
When you upload a file, it appends a few of its own variables. One of them
is size - assuming the file is a variable called $file:
if ($file_size > $max_size) {
echo $file_name . " was too big!";
}
Also, you could check for Mime types.
if ($file_type != "image/jpeg" || $file_type !
When I set and a
user uploads a file bigger than 50 my script prints a warning.
How can I use MAX_FILE_SIZE and avoid that warning so that I can print my
own error message to the user ?
:) Jacob
--
[ www.eksperten.dk ] Scandinavias biggest IT forum.
--
PHP General Mailing List (http://w
31 matches
Mail list logo