Importing Product Images via CSV in Magento 1.7.0.0

Many users have reported issues when trying to import images using the default Import/Export within Magento. I too have suffered this headache. Luckily, I have figured out a way to bypass any issues by separating out our import files.

Traditionally when we import our CSV, we have one giant document full of attributes. Including all the image references  Well, in my version don’t include the image attributes. Instead, we’ll put those into a new CSV along side a column with the SKU of the product.

In order to import a second CSV that is customised like this we’ll need a separate import profile. I’ll teach you how to create one now.

Step 1) Create the advanced profile

The solution is to create a custom import profile (System > Import/Export > Dataflow – Profiles). You only need to include the attributes that are required, which is just the SKU. Plus the appropiate image attributes. Plus labels if you want to go all out.

When you are creating your new profile, enter the following settings:

Magento Import Profile Setup

Magento Import Profile Setup

Now you can hit save! With our Profile now complete, we just need to create the folder media/import. This is where you will be storing all your images awaiting import.

Step 2) Create your Magento images import CSV

So now we have our profile created all we need to do is create our CSV. The CSV is pretty standard format. First of we have our SKU, and then followed by our image attributes.

When uploading images, they need to be within a folder called media/import. Once saved to that folder you can then reference them relatively. By that I mean if your image is in media/import/test.jpg in your csv reference it as /test.jpg. It’s as easy as that.

Now finally all you need to do is modify your CSV file to include only the following columns:

sku, image, image_label, small_image, small_image_label, thumbnail, thumbnail_label

Now you can upload and run the profile, sit back and breath.

Did this help you? Have any questions? Got any other tips like this? Let me know in the comments!

43 thoughts on “Importing Product Images via CSV in Magento 1.7.0.0

  1. ddgreat

    thanks for the tip however after i create the profile and go to profile actions xml i cannot edit the code in there.  should i be using the advanced profiles?

    Reply
  2. Ab

    Hi,

    I have magento 1.7.0.0 & I have created an Advanced Profile as you mention above. I have saved the profile, now how do I run it? I mean I am given no option to upload a CSV file in the DataFlow> Advanced profile section; in the DataFlow> Profile section I can upload a CSv & choose the file to import, but not with Advanced profile. What gives?

    Reply
  3. Poohhbearr1

    Hello,
    My images are now getting imported and I can view them in the backend. But in the front they are blank white placemarkers. It’s caching every picture. Any ideas

    Reply
    1. Ash Smith

       Have you cleared the cache (System > Cache Management) and tried re-indexing (System > Index Management)?

      That should do the trick, if not check the products in the admin and see if the images have been marked as currently in use (indicated with the radio box)

      Let me know how you get on!

      Reply
      1. marc

        any way to auto select these radiobuttons?
        i have 300 products with images but can’t get them auto select the base / thumbnail / small

        Reply
  4. Richard Parnaby-King

    Excellent help. In the admin panel, the images appear for the products but the radio-buttons for the image, small image and thumbnail options are all set to ‘no image’. How do I get them to change to the image that has been uploaded?

    Reply
  5. Yatrik

    Thanks for the info. I am also having the same problem as images are not diplaying in front-end but I can see them in back-end. I can also see radio button selected for all three coloumns too! I have cleared cache, re-indexed everything but still can’t see image on front! Anything else I can check?

    Regards.

    Reply
    1. Ash Smith

      When editing a product in the admin, when you rollover the image to see a preview does that show the image? and have you tried manually uploading one or two and seeing if that works?

      What I’m thinking is that if the image doesn’t show when you rollover for the preview then your folder permissions for the media folder may be incorrect resulting the images never actually being uploaded to the correct place.

      I’d try resetting the permissions (see here: http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions) and then re-importing

      Hope that helps, let me know if it does! :)

      Reply
      1. Yatrik

        Hi Ash, I can see the image by rolling over mouse and I have also uploaded a few image manually before. I can try resetting permissions through.

        Reply
      2. Yatrik

        I find one thing though may be that is the reason. Those image starts with t_123 and similar. In my Media > Catalog > product > t directory, I have a folder called _ and those images are in that folder. Is _ in filename is the problem? Shall I change the name to t123 instead?
        Thanks for the help.

        Reply
  6. Arturo Suarez

    Thanks a lot for the info! when I upload the cvs appears me ‘skip import row, is not valid value “” for field type’… How should be the fields of the CVS to avoid this error?

    Reply
    1. Ash Smith

      Make sure your data doesn’t effect the format of the CSV, if for example you’re importing a paragraph of text make sure you wrap it in quotes, to avoid commas counting as the next field. Equally, should you text contain double quotes or single quotes you would want to cancel them out too by adding back slashes around the quotes i.e.: “Like this”

      Hope that helps :)

      Reply
  7. Darren

    Great article! Can you post a example of the .csv? I’m not sure how the image file string is supposed to look.

    Reply
  8. Jan

    Excellent tip. Solved a problem, I had been dealing with and had been unable to resolve. Configurable parent sku’s did not have their images attached through “normal” csv import. Images could be seen on front end, but not in admin panel and if product was saved after import, the image also disappeared in the front end. This mapping obviously made the import more robust and solved the issue. Thanks a lot.

    Reply
  9. PSD to Magento .com

    I have the same problem as @Arturo Suarez
    when I upload the cvs appears me ‘skip import row, is not valid value “” for field type’…

    There is no texts only sku, image, small_image and thumbnail. I tried this solution but did not workm any help will be great. Version 1.7.0.2

    Thanks!

    Reply
  10. Steve

    Sometimes when doing an import in Magento from older shop system you are faced with lot of problems related to images and attributes. To proceed with product images import in bulk without issues use Store Manager for Magento.

    Reply
  11. Selvam

    Thanks and it works finally

    i did as follows,

    create folder under media/import

    and prepare the csv file by image column as /image_1/jpg (or if use under folder) /folder/image_1.jpg

    and “/”is must

    Reply
  12. raimundo vazquez

    I’ve found your tutorial very clear but the image with the settings to set up the profile is not displaying.
    Any change to reupload it?

    Reply
  13. James Phillips

    Step 2 gets a little unclear and flaky. Any chance you can go back and expand on that step? Am I exposed to make an additional folder called upload? You mention creating a folder named import, so it gets confusing.

    Reply
  14. Lukas

    I also get the “Skip import row, is not valid value “” for field “type”" error and I apparently don’t have the images in the right spot because I get “Image does not exist.” errors for all of them. Do I have the path right? I created a folder called upload in the already existent media folder in the magento root (actually its the dev server root so public_html/dev). Is that the correct place? I dropped a file “test.jpg” in there and the image value in the csv is “/test.jpg” (without the “)

    Reply
    1. Ash Smith Post author

      To add multiple images, simply add more rows underneath and specify the images in the same columns. Labels will need to be duplicated, however if you’re using a spreadsheet program like Excel then that’ll be a relatively simple job.

      Your CSV will look something like this

      sku, image, image_label, small_image, small_image_label, thumbnail, thumbnail_label
      mysku, image1.jpg, My Image, image1-small.jpg, My Image, image1-thumb.jpg, My Image
      ,image2.jpg, My Image,image2-small.jpg, My Image,image2-thumb.jpg, My Image
      ,image3.jpg, My Image,image3-small.jpg, My Image,image3-thumb.jpg, My Image

      Hope that helps :)

      Edit: Sorry for the line wrapping on the above code

      Reply
  15. Mel

    Hi,

    Is there a way to add related products to an item / sku using a csv import? i have tried creating a new profile but related product is not in the scroll down option. Thank you in advance.

    Reply
  16. misja

    Hello,

    O keep on getting the problem that the images are not found. Whether I put them in /media/import or /media/upload….

    Any help appreciated!

    Thanks,
    Misja

    Reply
  17. whitenoise100

    Really interesting and useful article, thank you!.

    I am 99% the way there with achieving this. The images are importing ok and showing on the front end once the indexes and caches are rebuilt.

    My issue is that if I go in to the products from the back-end, the images tab says that none are selected. One I re-save that product after an edit, the images are lost again. Any ideas?

    Reply
  18. AnthonyG

    I’ve got two sites using Magento, this works on one, but not the other. Any ideas why? Both are running Magento 1.7.0.2.

    On the one that doesn’t work, I’ve tried it by uploading the images directly in the /media/import folder and tried /media/import/i/m/image.jpg, neither worked. I’ve probably uploaded the CSV file 10 times trying to get it to work, but to no avail. Any suggestions?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>