mmsh Posted February 26, 2016 Share Posted February 26, 2016 (edited) Hello, at the moment seems that there's no way to correctly import/update external images into Prestashop http://www.othersite.com/img/high/15414518-7829.jpg My csv is correct, images are all in place, are there if you go to the source eg. Product ID;Reference;Name;URL Images "243";"90-C1SFE0-00";"PIKE 2108-32PD";"http://images.othersite.com/img/gallery/16713_7575276_6973.jpg,http://images.othersite.com/img/gallery/16713_7575276_5980.jpg,http://images.othersite.com/img/gallery/16713_7575276_1703.jpg" I tried with a few lines (about 60 lines) always returning with some: Error copying image:: http://images.othersite.com/img/gallery/18486465_7260.jpg .... .... I also tried with PHP memory unlimited...that's not the issue. So, this is a bug since a long time ('cause I saw many posts about this, since 2013 but even before...) How is possible that they don't fix this ...? How possible that, even if it worked by local path (as someone states...), we're force to first download images and then import them? And I'm not even sure that it works on local path at the moment.... Thanks Edited February 26, 2016 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
mmsh Posted February 26, 2016 Author Share Posted February 26, 2016 I think that there's something wrong on AdminImportController.php function copyImg on line 1025 protected static function copyImg (...) next week I will check but probably I will send a bug on Forge... 'cause it's time to fix this issue once for all Link to comment Share on other sites More sharing options...
eleazar Posted February 26, 2016 Share Posted February 26, 2016 I don't think you can import images from a subdomain. You have to enter a temp directory url of your shops' root directory. Link to comment Share on other sites More sharing options...
mmsh Posted February 27, 2016 Author Share Posted February 27, 2016 (edited) I don't think you can import images from a subdomain. You have to enter a temp directory url of your shops' root directory. thank you for your comment, which is really meaningful you know... "think" there should be a document about this, we should not guess what kind of URL goes there... couldn't the import do a simple image download? suppliers sometimes don't provide images, sometimes provide their URL a developer can't "think" we have to first manually download the images of so many products and then... ... .. Edited February 27, 2016 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
mmsh Posted February 27, 2016 Author Share Posted February 27, 2016 (edited) on the PS document: " The URL of the image must be an absolute link. In other words, it should be the link that may be used in a web browser in order to display the image. For instance: http://www.myprestashop/images/productXXX.gif." it doesn't mean anything.... it's not clearly stated that the URL must be on local server only... Edited February 27, 2016 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
mmsh Posted February 27, 2016 Author Share Posted February 27, 2016 (edited) and not only, I tried with an external URL and it worked... but it worked for one line only during my test... when the lines are more, instead, the behavior is unpredictable precisely because the routine is not well done, probably there's not a verification about the "download complete" and because of this... that function returns errors...AND It's not the end of the story...also, when it returns errors about copy, besides the fact that is not clear WHAT was wrong, it doesn't complete even the others...it stops and enough... it doesn't report eg. that ONE OF THEM failed and why... (in order to retry for the specific lines...) but it doesn't import anything... bad, bad, bad, bad :-D Edited February 27, 2016 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
libvb Posted February 29, 2016 Share Posted February 29, 2016 Hi mmsh, I really hope that you can tackle this issue. Looking forward for the solution. Link to comment Share on other sites More sharing options...
mmsh Posted February 29, 2016 Author Share Posted February 29, 2016 (edited) this issue at the moment is there... and I have no time to fix that, because studying and fixing that code is more time consuming that developing it from scratch by default it works fine just by local path, with the format: http://yourdomain.com/path/to/image.jpg So, unfortunately had to do my personal script in order to first download images and then write their URLs on a .csv to import later... then, the Admin Import often returns "EMPTY RESPONSE" if there are many lines to import, even if the process on server correctly ends so it doesn't seem to be a server issue... but I don't know what's the cause, if the Chrome window or other... Edited February 29, 2016 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
mmsh Posted February 29, 2016 Author Share Posted February 29, 2016 well, the empty response seems to be related to the Google DNS... when I changed DNS to those ones provided by my ISP... it didn't happen anymore anyway, when I have time...if no one from PS replies here, I will try to contact someone on Github or write on Forge... Link to comment Share on other sites More sharing options...
mmsh Posted March 13, 2016 Author Share Posted March 13, 2016 (edited) update: the empty response happens despite of the DNS... no errors on log, I can see that it correctly runs the script by the access log... because of many lines about ...GET /myfolder/download/img/filename.jpg HTTP/1.0" the script works but you can't always see the correct response by browser so I think they should find another more efficient method to do the import, maybe by cron.... setting a configuration with the file to import, the delimiters and so on... and let the user run it by cron (and CLI)... at least for dedicated servers Edited March 13, 2016 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
mmsh Posted March 13, 2016 Author Share Posted March 13, 2016 (edited) or... in addition to this splitting the file and make a realtime output eg. any 100 lines write first 100 rows imported... other 100 rows imported... and so on... p.s.: script executed in 22 minutes to update 3757 products with images (but the problem for empty response remains) Edited March 13, 2016 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
thetechno Posted March 24, 2016 Share Posted March 24, 2016 (edited) 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 March 24, 2016 by thetechno (see edit history) Link to comment Share on other sites More sharing options...
mmsh Posted March 24, 2016 Author Share Posted March 24, 2016 (edited) there is no solution at the moment for external images... they should know about it now you can only download the images where you need and then import by the format http://YOURwebsite.com/folder/image1.jpg,http://YOURwebsite.com/folder/image2.jpg,...,... ...and so on... and NOT ONLY better if you're sure that the images get httpcode 200 .. that is they are in place... otherwise the import stops with errors... Edited March 24, 2016 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
thetechno Posted April 2, 2016 Share Posted April 2, 2016 OK. But what technical issue is causing the problem when using previous versions. Why can I not use previous versions to upload images through CSV importing? Link to comment Share on other sites More sharing options...
simge Posted December 20, 2016 Share Posted December 20, 2016 I have same issue and I can't understand why there is no solution Link to comment Share on other sites More sharing options...
mmsh Posted December 20, 2016 Author Share Posted December 20, 2016 (edited) update: the import may return errors, but for images which are in place it works and the list is imported until the end... anyway, also wrote on github...impossible that they don't know about it, maybe they don't consider it critical...and it's wrong usually suppliers provide their image list, so download them on your server at first in a temp folder is a further, unwanted and avoidable step... unless the import script does it for you without further edit... definitely, the import script is incomplete Edited December 20, 2016 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
joe ramires Posted April 16, 2019 Share Posted April 16, 2019 @mmsh drama is that import script is not acting like a browser. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now