• Resolved fmarchioni

    (@fmarchioni)


    Hi all,
    I’m evaluating this plugin, before buying the supported version, to see if it’s able to import correctly the products and images from my magento website.
    The import of products and categories was successful, however all images failed to download:
    [ERROR] Can’t copy https://www.casarredastore.it/media/catalog/product/m/o/mod.nicole8scatto.jpg to /var/www/html/wp/wordpress/wp-content/uploads/2018/03/mod.nicole8scatto.jpg : cURL error 7:
    . . . . .
    I have checked the permission in the target folder and it’s 777 so it should work.
    Is it an issue caused by https? (The site runs on https)
    Aside from that, I have tried to manually curl the image in the target uploads folder and it worked. But then the image still doesn’t display in the Product.
    Any help?
    Thanks!

    • This topic was modified 5 years, 2 months ago by fmarchioni.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Kerfred

    (@kerfred)

    Strange. The image URL is correct. It should work.
    Is there any issue with curl on your WordPress server?
    What is the detail of the curl error?

    Thread Starter fmarchioni

    (@fmarchioni)

    Thanks for the reply. I’m afraid that is all I have got from the logs:
    [ERROR] Can’t copy https://www.casarredastore.it/media/catalog/product/m/o/mod.nicole8scatto.jpg to /var/www/html/wp/wordpress/wp-content/uploads/2018/03/mod.nicole8scatto.jpg : cURL error 7:

    I have tried with this PHP function and it also works:

    function download_image1($image_url, $image_file){
        $fp = fopen ($image_file, 'w+');              // open file handle
    
        $ch = curl_init($image_url);
        // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // enable if you want
        curl_setopt($ch, CURLOPT_FILE, $fp);          // output to file
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, 1000);      // some large value to allow curl to run for a long time
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
        // curl_setopt($ch, CURLOPT_VERBOSE, true);   // Enable this line to see debug prints
        curl_exec($ch);
    
        curl_close($ch);                              // closing curl handle
        fclose($fp);                                  // closing file handle
    }

    Can you recommend any place in the plugin where I can try to include the same curl_setopt ?
    Thanks

    • This reply was modified 5 years, 2 months ago by fmarchioni.
    Plugin Author Kerfred

    (@kerfred)

    It is in the file admin/class-fg-magento-to-woocommerce-admin.php in function remote_copy() line 2862, I use the WordPress function wp_remote_get(), not curl directly.

    Did you try to run the migration on another server, or on your local computer?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issues with importing images’ is closed to new replies.