user2377924
user2377924

Reputation: 1

File upload issue with size

I have set maximum file upload size as 6 MB in php.ini file.If I tried to upload a file more than 6 MB for Ex:6.02 MB $_FILES return an array with error=0.

But If I tried to upload an image more than 10 MB $_FILES return an empty array.Even I increase the memory_limit,upload_max_ file-size,post_max_size using ini_set still $_FILES return an empty array.Give me a solution to this problem.Thanks in advance.

<form enctype="multipart/form-data" method="post" id="addphoto" action="<?=$confValues['COMM_IMAGEURL']?>/photo/upload.php?communtiyId=<?base64_encode(base64_encode($confValues['DOMAINCASTEID']))?>" name="addphoto" >
    <input name="frmAddPhotoSubmit" id="frmAddPhotoSubmit" type="hidden" value="yes">

    <?php $varEncryptedId = encrypt(rand(1,999).'~'.substr($sessMatriId,3).'~'.substr($sessMatriId,0,3).'~'.rand(1,999),$varSalt); ?>

    <input name="autoid" id="autoid" type="hidden" value="<?=$varEncryptedId;?>">
    <input type="hidden" value="add" id="actionval" name="actionval"/>
    <input type="hidden" value="editphoto" id="act" name="act"/>
    <input type="hidden" value="<?=$_COOKIE['profileInfo']?>"  name="cookieprofileinfo"/>
    <input type="hidden" value="<?=$varGetCookieInfo['PHOTO']?>"  name="photocookie"/>                                              
</form>

upload.php:

$varTmpPhoto        =   $_FILES['newphoto'];
$varPhotoPath       =   $_FILES['newphoto']['tmp_name'];
$varPhotoName       =   $_FILES['newphoto']['name'];
$varPhotoSize       =   $_FILES['newphoto']['size'];
$varUpPhotoError            =   (int)$_FILES['newphoto']['error'];
$varDate            =   date('Y-m-d h:m:s');

in this file $_FILES return an empty array.These are my files.

Upvotes: 0

Views: 138

Answers (1)

Sundar
Sundar

Reputation: 4650

You have to increase the max_upload_file size and post_max_size to receive files

consider this changes into php.ini file.

http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize

http://www.php.net/manual/en/ini.core.php#ini.post-max-size

Upvotes: 0

Related Questions