image size problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

image size problem

Post by itsmani1 »

On upload I wanted to find size of the image but when i tried to upload an image of size more than 2MB its give me 0.

Here is code:

Code: Select all

echo $_FILES['imgfile1']['size'];
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: image size problem

Post by jaoudestudios »

Probably because php is running out of memory.

If you get 0, does the file still upload ok?

In the php.ini file you can increase the upload size and memory usage size
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Re: image size problem

Post by itsmani1 »

Event tried

Code: Select all

define('MAX_FILE_SIZE', 3072);
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Re: image size problem

Post by itsmani1 »

No does not upload.

Its a shared server, can't access .ini file.

any solution without .ini file?


Regards,
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: image size problem

Post by jaoudestudios »

itsmani1 wrote:No does not upload.
Definitely reaching a limit.

Hmm you can try with php ini_set() but dont think it will over-ride php.ini file.
Post Reply