• Resolved Rhys Wynne

    (@rhyswynne)


    Hi There,

    Is there any way to force the WooCommerce importer or wp_handle_sideload to treat an image URL as an image?

    I’m importing a bunch of products with variations and it’s working well, but it cannot grab the image from the URL. For some reason, even though the URL of the image is responding with the correct MIME type in the header (image/jpeg), the importer doesn’t treat it as such.

    Writing to the log at certain points for whatever reason it doesn’t seem to realise the image is an image. An example image – which you can see there isn’t a file extension – is attached (I’m working locally).

    Checking it for whatever reason I cannot figure out why it’s not.

    • I’m doing an importer with another system (WP All Import) and it works fine – it’s because it cannot handle custom product types means we have to use the default uploader.
    • Downlaoding the image and hosting it elsewhere works, but it’s unworkable (we have 5000 images)
    • Allowing unfiltered uploads define('ALLOW_UNFILTERED_UPLOADS', true); produces another error. It uploads the file but it’s unable to attach it to the post. It doesn’t show as a media file but when I download the file I can open it as an image.
    • I’ve ruled out plugin/theme conflicts as I’ve only WordPress, WooCommerce and TwentyTwentyFour installed.

    What would be ideal would be a way to force the WooCommerce importer in the CSV to treat the file as an image, even though for some reason it’s not able to detect the fact it’s an image.

    Any ideas?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @rhyswynne,

    Thank you for reaching us about this! Let’s take a look at the options from our documentation first:

    • Images need to be pre-uploaded or available online to import to your store.
    • External URLs are supported and imported into the Media Library if used, provided the images are directly accessible and not behind a redirect script (as happens on some cloud storage services).
    • You can define the filename if the image already exists in the Media Library.
    • The core CSV importer does not currently have the ability to add, edit or update alt text for product images.

    I’ve highlighted the one that I think could be a viable option here, have you considered uploading all the media to your library first, then run the importer and use the file name to map the images to the products?

    I hope this helps!

    Cheers!
    -OP

    Thread Starter Rhys Wynne

    (@rhyswynne)

    Hi OP,

    Thanks for your input.

    Whilst it didn’t solve the issue, I think I’ve found a workaround. In essence I’ve created a media library on a separate domain (I’ve approximately 5k images), uploaded them using WP All Import, and then pointing the CSV to look at the new image within the media library.

    It seems to have worked now.

    Thanks

    Rhys

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hey Rhys @rhyswynne!

    Thanks a lot for sharing your workaround with us! I see you went with the previous point on the list. I love outside the box ideas! And more importantly I’m happy to learn you’ve fixed your issue!

    If you have a few minutes, we’d love if you could leave us a review:?https://www.ads-software.com/support/plugin/woocommerce/reviews/.

    Cheers!
    -OP

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WooCommerce Importer cannot detect the MIME type of images’ is closed to new replies.