Jump to content

Error Copying Image


libvb

Recommended Posts

Hi,

 

I've read many of the threads concerning this issue, but still was not able to fix it.

This store is running Prestashop 1.6.1.3.

 

I'm trying to import a csv file with just one product and one image for the product.  The server generates the error message "Error copying image upload/vr.jpg"

The vr.jpg file is about 230kb.

 

In classes/Tools.php, placed var_dumps to $source and $destination:

string(14) "/upload/vr.jpg"
string(49) "/usr/local/www/prestashop/img/tmp/ps_importhld2fh"

Then, did the same thing in AdminImportController.php after the comment // associate image to selected shops, lines 1829...

and got:

$product->id: string(1) "2"
$image->id: string(2) "27"
$url: string(13) "upload/vr.jpg"
$regenerate: string(0) ""

But could not understand why I get the error.  Tried already to place the picture in different locations, use absolute and relative paths.

Tried http://localhost/vr.jpg

         http://192.168.0.2/vr.jpg

 

         all with single, double or no quotes, the image is always retrieved.

 

When executing the import csv procedure, the working directory is in /admin/, am I right?  One should use relative paths from there?

Is there a defined place where to upload the images to the server?

 

 

I'd appreciate help on this.





 

Edited by libvb (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Prestashop please update your system and let us upload our images with a CSV file again!!!

 

 

 

Hello. Did anyone find a solution for this issue because I am experiencing the same?

 

 

 

I am using Prestashop 1.6.1.4.

 

I tried many suggestions:

 

1) changed the permission of the folder in cpanel

2)used image urls without dashes, underscores or other special characters

3) changed the Classes/Tools.php file replacing

From:

"return @copy($source, $destination, $stream_context);"

 

to:

"return @copy($source, $destination);"

4) I updated my Prestashop version

5)disabled and re-enabled mod security.

6) I also tried 5 different versions of prestashop believing that it was a version bug but all to no avail.

 

Could it be an external issue outside prestashop because I went back to PS 1.5.x.x and had the same issue? That should not happen because

 my image urls were uploading back then and on up to 1.6.0.x. Like a host or IP configuration issue?

Edited by thetechno (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...