forms - PHP large file uploads not going through -


what's going on here? have a form works precisely intended smaller files, yet try uploading larger, form fails. don't know size limit is, doesn't work 40mb file.

normal files return error of 0, meaning they've uploaded successfully, large files, don't error. it's if nothing in form passed through, , includes values of every other input in form well. there's large files stops in form working.

i've gone through php.ini make sure upload_max_filesize , post_max_size values high enough, (200m each). since server local, , files test 'uploaded' instantaneously, i've made sure max_execution_time high enough (1200).

the form uses post, enctype multipart/form-data, , i've tried using form has nothing more file input , submit button.

this uploading code (ie, code in action page form redirects to):

<?php  require_once($_server['document_root'] . '/resources/recaptchalib.php'); $privatekey = "abc123"; $resp = recaptcha_check_answer($privatekey,          $_server["remote_addr"],         $_post["recaptcha_challenge_field"],         $_post["recaptcha_response_field"]); if (!$resp->is_valid) {     echo "<h1>" . $content['uploaderror'] . "</h1>"             . $content['uploadcaptcha'] . "<br><br>"             . $content['uploadreturn']; } else {     $name = $_post['name'];     $email = $_post['email'];     if (empty($name)) {         echo "<h1>" . $content['uploaderror'] . "</h1>" .                 $content['uploadname'] . "<br><br>" .                 $content['uploadreturn'];     } elseif (empty($email)) {         echo "<h1>" . $content['uploaderror'] . "</h1>"                 . $content['uploademail'] . "<br><br>"                 . $content['uploadreturn'];     } else {         $url = $_post['url'];         $notes = $_post['notes'];         $timedate = date('ymdhis');         $dbhandle = new pdo("mysql:host=localhost;dbname=upload;", "user", "pass",                 array(pdo::attr_emulate_prepares => false));         $dbhandle->setattribute(pdo::attr_errmode, pdo::errmode_exception);         $query = $dbhandle->prepare("insert `data` "                 . "(approved,name,email,fileid,url,notes,timedate,viewcount) "                 . "values(?,?,?,?,?,?,?,?)");         $types = array(             'jpg', 'jpeg', 'gif', 'png',             'mp3', 'wma', 'wav', 'ogg', 'aac', 'flac',             'avi', 'wmv', 'mov', 'ogg', 'webm', 'mpg', 'mpeg', 'mp4'         );         $filechk = (isset($_files['file']) && !empty($_files['file']['name']));         $urlchk = (isset($url) && !empty($url));         if (!$filechk ^ $urlchk) {             echo "<h1>" . $content['uploaderror'] . "</h1>"                     . $content['uploadfileurl'] . "<br><br>"                     . $content['uploadreturn'];         } elseif ($filechk) {             $filesize = (75 * 1024 * 1024);             $up_path = $_server['document_root'] . '/resources/uploads/';             $filename = $timedate . $_files['file']['name'];             $ex = explode(".", $filename);             $ext = strtolower(end($ex));             if (file_exists($up_path . $filename)) {                 $filename = $timedate . 'duplicate.' . $ext;             }             if (!in_array($ext, $types)) {                 echo "<h1>" . $content['uploaderror'] . "</h1>"                         . $content['uploadfiletype'] . "<br><br>"                         . $content['uploadreturn'];             } elseif (filesize($_files['file']['tmp_name']) > $filesize) {                 echo "<h1>" . $content['uploaderror'] . "</h1>"                          . $content['uploadfilesize'] . ($filesize / 1024 / 1024) . " mb<br><br>"                         . $content['uploadreturn'];             } elseif (!is_writable($up_path)) {                 echo "<h1>" . $content['uploaderror'] . "</h1>"                         . $content['uploadwriteerror'] . "<br><br>"                         . $content['uploadreturn'];             } elseif (move_uploaded_file($_files['file']['tmp_name'], $up_path . $filename)) {                 $fileid = $filename;                 $url = null;                 $query->execute(array('n', $name, $email, $fileid, $url, $notes, $timedate, '0'));                 echo "<h1>" . $content['uploadsuccess'] . "</h1>"                          . $content['uploadhomepage'];             } else {                 echo "<h1>" . $content['uploadunknownerror'] . "</h1>"                          . $content['uploadreturn'];             }         } else {             $fileid = null;             $query->execute(array('n', $name, $email, $fileid, $url, $notes, $timedate, '0'));             echo "<h1>" . $content['uploadsuccess'] . "</h1>"                      . $content['uploadhomepage'];         }     } } ?> 

var_dump($_files) results in array(0) { }

so php.ini appears fine, code appears fine (since can upload smaller files)...what missing here?

check limits in php.ini, there's more 1 setting -

upload_max_filesize = 64m post_max_size = 64m 

make sure restart apache settings changes take effect.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -