By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,748 Members | 2,043 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,748 IT Pros & Developers. It's quick & easy.

$_FILES[var][size] Question

P: n/a
I'm uploading a file to the server - I check the $_FIILES[var][size]
variable to check for exceeding a certain limit (250KB in this case) _
I notice that when I try to upload files of 500KB or 900KB [size]
holds the value and I can check it - however, if I try to upload a
2300KB file [size] is 0 - does anyone know what might be causing this?
Why doesn't that large of a file also get recorded in the [size]
variable?

Thanks...

Jul 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Ralph,
I'm uploading a file to the server - I check the $_FIILES[var][size]
variable to check for exceeding a certain limit (250KB in this case) _
I notice that when I try to upload files of 500KB or 900KB [size]
holds the value and I can check it - however, if I try to upload a
2300KB file [size] is 0 - does anyone know what might be causing this?
Why doesn't that large of a file also get recorded in the [size]
variable?

The problem seemed to be the upload limit of 2MB which is
default in PHP.ini.
Kind Regards.

Karl Heinz
--
Dipl.Ing.(FH) Karl Heinz Marbaise | Minkenberg Medien GmbH
Projektleiter | www.minkenberg-medien.de
Tel.: +49 (2452) 98 91 40 | Roermonderstr. 128a
Fax.: +49 (2452) 98 91 42 | D-52525 Heinsberg

Jul 16 '05 #2

P: n/a
Ralph Freshour wrote:
I'm uploading a file to the server - I check the $_FIILES[var][size]
variable to check for exceeding a certain limit (250KB in this case) _
I notice that when I try to upload files of 500KB or 900KB [size]
holds the value and I can check it - however, if I try to upload a
2300KB file [size] is 0 - does anyone know what might be causing this?
Why doesn't that large of a file also get recorded in the [size]
variable?

Thanks...


that's indeed because upload_max_filesize in php.ini is set to 2Mb by
default. Change it as you like, for example:

upload_max_filesize = 8M
HTH
niels

Jul 16 '05 #3

P: n/a
Is there anyway to detect when someone has tried to upload file
exceeding the php.ini limit of 2MB? I noticed that
$_FILES[filename][size] == 0 if there is no file selected or if a file
was selected and it exceeds 2MB - I've tried using the time() function
but the differences was very small between loading no file and loading
a 2MB+ file - I'd like to detect the difference so I can display a msg
to the user accordingly...
On Wed, 27 Aug 2003 16:02:07 +0200, nylz <ny**@email.it> wrote:
Ralph Freshour wrote:
I'm uploading a file to the server - I check the $_FIILES[var][size]
variable to check for exceeding a certain limit (250KB in this case) _
I notice that when I try to upload files of 500KB or 900KB [size]
holds the value and I can check it - however, if I try to upload a
2300KB file [size] is 0 - does anyone know what might be causing this?
Why doesn't that large of a file also get recorded in the [size]
variable?

Thanks...


that's indeed because upload_max_filesize in php.ini is set to 2Mb by
default. Change it as you like, for example:

upload_max_filesize = 8M
HTH
niels


Jul 16 '05 #4

P: n/a
On Thu, 28 Aug 2003 04:00:25 GMT
Ralph Freshour <ra***@primemail.com> wrote:
Is there anyway to detect when someone has tried to upload file
exceeding the php.ini limit of 2MB?


Use: $_FILES['userfile']['error']

http://au.php.net/features.file-upload
http://au.php.net/manual/en/features...oad.errors.php

Matt

<SNIP>
--
Quispiam Power Computing | "There are two major products that come out
Pendle Hill, Australia | of Berkeley: LSD and UNIX. We don't believe
+61 2 9688 2894 | this to be a coincidence. "
www.quispiam.com | - Jeremy S. Anderson
Jul 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.