editorstefan Posted September 15, 2013 Share Posted September 15, 2013 (edited) I get error as you see below when i try to import products with image. Please help me solve this ASAP! Error copying image: http://www.mywebsite.com/img/p/import/I5-5658-1.jpg Error copying image: http://www.mywebsite.com/img/p/import/I5-5660-1.jpg I have Prestashop 1.5.5 I write image url as http://www.mywebsite.com/img/p/import/I5-5658-1.jpg in the .csv file. All images are uploaded to the "import" folder via FTP. Folder import and p both have permission 777. I import about 60 products with only 1 image per products. Please is there anything i can do to import the products with images? SOLUTION: Open - Classes/Tools.php Change line number 1408 From: "return @copy($source, $destination, $stream_context);" to: "return @copy($source, $destination);" It should work, it is a small bug in prestashop 1.5.5 Regards Vivek Sakhilati Edited September 19, 2013 by vekia (see edit history) Link to comment Share on other sites More sharing options...
Dh42 Posted September 15, 2013 Share Posted September 15, 2013 Ask your host if you are running DSO php interpreter. Also, ask if mod security is enable, if they are ask them to disable both. Link to comment Share on other sites More sharing options...
editorstefan Posted September 15, 2013 Author Share Posted September 15, 2013 Ask your host if you are running DSO php interpreter. Also, ask if mod security is enable, if they are ask them to disable both. Ok, i will call them in the morning. But can you explain what DSO php interpreter and mod security is? It's a swedish host so i need to know how to explain to them Thank you! Link to comment Share on other sites More sharing options...
Dh42 Posted September 15, 2013 Share Posted September 15, 2013 DSO is a php interpreter, it sometimes causes permissions problems with Prestashop. Mod security is an apache module that causes issues saving to directories and opening files. It can only use relative urls and not the full path, so that is why it has problems. Link to comment Share on other sites More sharing options...
editorstefan Posted September 16, 2013 Author Share Posted September 16, 2013 DSO is a php interpreter, it sometimes causes permissions problems with Prestashop. Mod security is an apache module that causes issues saving to directories and opening files. It can only use relative urls and not the full path, so that is why it has problems. I have talked to them now and they turned MOD security off but they couldnt find ane DSO but they thought that may be beacuse it doesnt even exist on my server. I have tried to import but it still doesnt work.. i get same error - PLEASE HELP! Link to comment Share on other sites More sharing options...
editorstefan Posted September 16, 2013 Author Share Posted September 16, 2013 Please can anyone help with this ASAP!? Link to comment Share on other sites More sharing options...
editorstefan Posted September 18, 2013 Author Share Posted September 18, 2013 I have tested to import the procuts in localhost in Prestashop version 1.5.4 and it worked perfect! So that means Prestashop 1.5.5 does not work with csv import for products!! Please can someone help me and all the other people who upgraded to fix this?! Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 18, 2013 Share Posted September 18, 2013 Hi, I think this is a server issue. I wonder if you tried to import products on localhost with 1.5.5 if it would work. This test would tell us if the problem is with a server config, or with the actual 1.5.5 package. Link to comment Share on other sites More sharing options...
editorstefan Posted September 18, 2013 Author Share Posted September 18, 2013 There is also another guy who tried with 1.5.5 and didnt work. How can i test on a 1.5.4 online server? I dont have any so how can i "downgrade"? Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 18, 2013 Share Posted September 18, 2013 Just use your local host and install 1.5.5 then import your csv. Test it and see if it works and update us please. Thank you! Link to comment Share on other sites More sharing options...
editorstefan Posted September 18, 2013 Author Share Posted September 18, 2013 Just use your local host and install 1.5.5 then import your csv. Test it and see if it works and update us please. Thank you! Ok i have done it and it's working :/ :/ In localhost i imported with EXACTLY same csv so the image url was from my actuall live server. http://www.mywebsite.com/img/p/import/I5-5658-1.jpg Another guy has sam problem and hes 1.5.4 works good on same server but 1.5.5 don't. Maybe 1.5.5 doesn't work on live servers for some reason or any idea why? Link to comment Share on other sites More sharing options...
MToscan Posted September 19, 2013 Share Posted September 19, 2013 Same problem here. I have just tested 5 records Error copying image: http://www.tentacula.../upload/951.jpg Error copying image: http://www.tentacula.../upload/952.jpg Error copying image: http://www.tentacula.../upload/953.jpg Error copying image: http://www.tentacula.../upload/954.jpg Error copying image: http://www.tentacula.../upload/955.jpg Seems like a common issue. Link to comment Share on other sites More sharing options...
vekia Posted September 19, 2013 Share Posted September 19, 2013 i think that solution is here: http://www.prestashop.com/forums/topic/274479-error-copying-image/ Link to comment Share on other sites More sharing options...
editorstefan Posted September 19, 2013 Author Share Posted September 19, 2013 i think that solution is here: http://www.prestashop.com/forums/topic/274479-error-copying-image/ Thank you! that fixed my problem, please mark thread as [sOLVED]! Link to comment Share on other sites More sharing options...
vekia Posted September 19, 2013 Share Posted September 19, 2013 glad to hear that it works im going to mark topic as [solved] exactly as you suggested Link to comment Share on other sites More sharing options...
J-works.cz Posted October 28, 2013 Share Posted October 28, 2013 I have tested to import the procuts in localhost in Prestashop version 1.5.4 and it worked perfect! So that means Prestashop 1.5.5 does not work with csv import for products!! Please can someone help me and all the other people who upgraded to fix this?! Hello, I also have some problem with CSV import - images are not imported (localhost and live server). Please, would you be so kind and send me a CSV sample file, that is 100% working? I will try it on my localhost and then on my live server. Thank you very much Link to comment Share on other sites More sharing options...
J-works.cz Posted November 1, 2013 Share Posted November 1, 2013 Please see link below - there is TXT file that is working on my site - images are uploaded. Just change the extension of file to CSV and try it. http://www.prestashop.com/forums/topic/285936-how-to-import-products-with-images/?do=findComment&comment=1441347 Link to comment Share on other sites More sharing options...
agilewebsolutions Posted May 18, 2018 Share Posted May 18, 2018 Maybe you remembered the quotes, I did not. But after adding "quotes" it works. in newer versions. Link to comment Share on other sites More sharing options...
Per617 Posted February 7, 2021 Share Posted February 7, 2021 I have the same problem, error copying image. Im using my Prestashop version 1.6.1.24 Ande solution for my problem? Link to comment Share on other sites More sharing options...
zigu007 Posted July 12, 2022 Share Posted July 12, 2022 In my case, it was a problem with SSL certificate verification. Tools::file_get_contents() method is wrong constructed. For the time of importing, I changed the code like this: # /classes/Tools.php public static function copy($source, $destination, $stream_context = null) { if (null === $stream_context && !preg_match('/^https?:\/\//', $source)) { return @copy($source, $destination); } // OLD: return @file_put_contents($destination, Tools::file_get_contents($source, false, $stream_context)); // NEW: return @file_put_contents($destination, file_get_contents($source, false, stream_context_create(array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, ), )))); } Hope this helps someone 🙂 1 Link to comment Share on other sites More sharing options...
EngineS Posted July 28, 2023 Share Posted July 28, 2023 On 7/12/2022 at 10:52 AM, zigu007 said: In my case, it was a problem with SSL certificate verification. Tools::file_get_contents() method is wrong constructed. For the time of importing, I changed the code like this: # /classes/Tools.php public static function copy($source, $destination, $stream_context = null) { if (null === $stream_context && !preg_match('/^https?:\/\//', $source)) { return @copy($source, $destination); } // OLD: return @file_put_contents($destination, Tools::file_get_contents($source, false, $stream_context)); // NEW: return @file_put_contents($destination, file_get_contents($source, false, stream_context_create(array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, ), )))); } Hope this helps someone 🙂 Thanks to this i solved it. I'm on version 1.7.6.5 Link to comment Share on other sites More sharing options...
DJPhill Posted September 5, 2023 Share Posted September 5, 2023 On 7/12/2022 at 9:52 AM, zigu007 said: In my case, it was a problem with SSL certificate verification. Tools::file_get_contents() method is wrong constructed. For the time of importing, I changed the code like this: # /classes/Tools.php public static function copy($source, $destination, $stream_context = null) { if (null === $stream_context && !preg_match('/^https?:\/\//', $source)) { return @copy($source, $destination); } // OLD: return @file_put_contents($destination, Tools::file_get_contents($source, false, $stream_context)); // NEW: return @file_put_contents($destination, file_get_contents($source, false, stream_context_create(array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, ), )))); } Hope this helps someone 🙂 YES! Thank you so much. Images being imported again IS it ok to leave this like this? Or do we need to change it back everytime? Thanks. 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