简体   繁体   English

文件上传的大小问题

[英]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. 我已在php.ini文件中将最大文件上传大小设置为6 MB。如果我尝试上传的文件大小超过6 MB,例如:6.02 MB $ _FILES返回一个错误= 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. 但是,如果我尝试上传超过10 MB的图像,则$ _FILES返回一个空数组。即使我使用ini_set增加memory_limit,upload_max_文件大小,post_max_size仍然$ _FILES返回一个空数组,请给我一个解决此问题的方法。提前。

<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: 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. $ _FILES在这个文件中返回一个空数组。这些是我的文件。

You have to increase the max_upload_file size and post_max_size to receive files 您必须增加max_upload_file的大小和post_max_size才能接收文件

consider this changes into php.ini file. 考虑将其更改为php.ini文件。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM