Uploading files occurs on ajax. The problem is that if the file is more than 2 mb., Then the class for creating a thumbnail does not work, or rather gives an error like:

Warning: getimagesize(Z:/home/shop/www/public/uploads/002.jpg) [function.getimagesize]: failed to open stream: No such file or directory in Z:\home\shop\www\admin\systems\classes\uploads.class.php on line 18 Warning: Division by zero in Z:\home\shop\www\admin\systems\classes\uploads.class.php on line 84 

and this is not the whole list.

I realized that it gives an error, because the file has not yet had time to load, and they already say it, let's process it.

I do this:

 move_uploaded_file($value['tmp_name'], $this -> dir . $new_name_file); $new_image = new SimpleImage($this -> dir . $new_name_file); $new_image -> imageresizewidth($thumb_img_resize_width); $new_image -> imagesave($new_image -> image_type, $this -> dir . 'thumb/' . $new_name_file); $new_image -> imageout(); 

How can I solve this problem?

  • one
    The error is that the file did not fall into the public/upload folder. In the settings of the server php.ini (or somewhere in the ini_set) set the maximum size of the file being downloaded? - Vasily Barbashev

1 answer 1

Solved the problem by writing in .htaccess

 php_value max_execution_time 500 php_value max_input_time 500 php_value upload_max_filesize 30M php_value post_max_size 30M