Lenny Magico
Lenny Magico

Reputation: 1203

PHP upload restriction

I have a php upload script wich cycles through 18 files which it should upload average size about 8 MB, but the website isn't uploading all the files, however if I try it with 2 or 3 it works fine, so is there a limit for security reasons or something?

EDIT: Thank You for all your answers, there is more than one answer that is correct, so unfortunately I can't mark all of them correct but thank you for the attempt :)

Upvotes: 0

Views: 256

Answers (3)

SIFE
SIFE

Reputation: 5695

@John I think this not related to memory, instead, its related file size upload limit by php.ini, so try to chnage this in php.ini:

upload_max_filesize = 170M // 8 * 18 ~ 160

If you can't access to php.ini, you can try to add this line to .htaccess file in your root directory:

php_value upload_max_filesize 170M

Note: Your script may file if some file is bigger then your memory limit. So keep in your mind that memory used to store file during upload progress.

Upvotes: 1

beta
beta

Reputation: 268

in php.ini change

upload_max_filesize = 100M or your number

memory_limit = 128M or your number

and

post_max_size = 100M

Upvotes: 3

John Cartwright
John Cartwright

Reputation: 5084

Are you getting any errors? If you aren't seeing them, check your php error log.

Try increasing the PHP's memory limit,

ini_set('memory_limit', '128mb');

And try increasing the time limit on your script,

set_time_limit(0); //infinite

Upvotes: 2

Related Questions