cancel
Showing results for 
Search instead for 
Did you mean: 

Problem uploading images to products

Re: Problem uploading images to products

@Rahul Gupta  it have not worked.

 

Comment that in the same server I have other CMS like Wordpress where I can upload images without problem.

 

I think it must be an specific problem of configuration with Magento 2.

 

Thanks.

Re: Problem uploading images to products

@Rahul Gupta   @theMageComp  Any other idea about what could it be the problem?

 

Thanks!

Re: Problem uploading images to products

@Multiplicalia have you tried out by creating new product?

Re: Problem uploading images to products

https://magento.stackexchange.com/questions/127586/magento-2-can-not-upload-product-images

 

 

Please refer above link .It because of server configuration in magento2

Re: Problem uploading images to products

Thanks for your answers but I have not been able to solve the problem

@Rahul Gupta  I have created a new product and the problem persists.

 

@aditya_kalambhaI have tried the information in that post without luck. I have used the php test script they mentions and it uploads image correctly.

 

I have thought I can follow the magento code which control the uploading of products to reach a solution but I don't know where it is. Does someone know which php file controls the uploading of images in products?

 

Note: I attach the ajax response when I try to upload the image. It shows "The file was not uploaded" error code 666. And the problem occurs not only in products. If i try to upload category images or block images, it fails too.error.png

Note 2: in vendor/magento/framework/file/Uploader.php the problem seems to be in the construct method. $this->_file is empty and it throw exception "The file was not uploaded".

I don't understand why $this_>_file is empty, if I print $_FILES, it contents the image uploaded.

 

 

Thanks.

Re: Problem uploading images to products

Finally I have solved it.

It was that a developer had modified the function _setUploadFileId in /vendor/magento/framework/file/Uploader.php and the modification was the problem.