javascript php upload images request entity too large -
i have php javascript images upload problem. when upload 20kb, ok. when upload on 500kb, fails , displays error shown below. web site hosted on godaddy. in local development computer works , runs smoothly. have ideas??
i have tried:
ini_set('post_max_size',52428800); // 50 mb
ini_set('upload_max_filesize',52428800) // 50 mb not work.
//------error on web pag----------
request entity large requested resource /index.php/newpost/ not allow request data requests, or amount of data provided in request exceeds capacity limit.
additionally, 500 internal server error error encountered while trying use errordocument handle request.
//------------my code----------------------//
function uploadimages($input, $file) { if($input == null || $input == "") { return false; } $stringval = $input; $value = str_replace('data:image/png;base64,', '', $stringval); if ($this->check_base64_image($value) == false) { return false; } $actualfile = base64_decode($value); $img = imagecreatefromstring($actualfile); $imgsize = getimagesize('data://application/octet-stream;base64,' . base64_encode($actualfile)); if ($img == false) { return false; }else { /*** maximum filesize allowed in bytes ***/ $max_file_length = 100000; log_message('debug', 'pre uploading!!!!!!!!'); if (isset($img)){ log_message('debug', 'uploading!!!!!!!!'); // check file less maximum file size if($imgsize['0'] > $max_file_length || $imgsize['1'] > $max_file_length) { log_message('debug', 'size!!!!!!!!'.print_r($imgsize)); $messages = "file size exceeds $max_file_size limit"; return false; }else if (file_exists($file)) { return false; }else { file_put_contents($file, $actualfile); return true; } } } }
Comments
Post a Comment