cancel
Showing results for 
Search instead for 
Did you mean: 

How to organise images when importing cvs into my own structure

SOLVED

How to organise images when importing cvs into my own structure

In the docs of magento2

 

Method 1: Import Images from the Local Server

On the Magento server, upload the image files to the pub/media/import 
folder. This is the default folder for importing
product images.

[magento installation folder]/pub/media/import 

You can use a different folder on the Magento server, **as long as the
path to the folder is specified during the import process**.

 

You can use a different folder on the Magento server, as long as the path to the folder is specified during the import process.

I'm trying to do so but did not find the correct way. I want to sort my files myself. All files start with TO100.2240.png TO120.6255.png and so on.

So I want to put them in folders TO100/ TO120/ when I now import into magento2 magento plces the files in /t/0/ folder. So all files are in the same folder 4000+ images.

like: pub/media/catalog/labels/to100/files start from 'to100' pub/media/catalog/labels/to120 files start to120 and so on.

 

what is the exact path then to keep my structure?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to organise images when importing cvs into my own structure

The correct way to import:


images File Directory: (path from magento root)

pub/media/import

NO slash at beginning or end

base_image:

formaten/sub100/100258.png

NO slash at beginning

 

This is where I did wrong.

I tested

images File Directory:

/pub/media/import   NOT correct don't add / at beginning

pub/media/import/  NOT correct don't add / at end

for base  image

/formaten/sub100/100258.png NOT correct no / at beginning

View solution in original post

5 REPLIES 5

Re: How to organise images when importing cvs into my own structure

Probably you need to customization for your requirement, In your snapshot, you are talking about save images in your custom architecture, while Magento provides the different path to add your images before import instead of default pub/media/import path.

 

You can add your images to a separate folder and add your new path to import form.

 

You can check link, https://www.rakeshjesadiya.com/how-to-import-image-using-csv-in-magento-2/

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: How to organise images when importing cvs into my own structure

The correct way to import:


images File Directory: (path from magento root)

pub/media/import

NO slash at beginning or end

base_image:

formaten/sub100/100258.png

NO slash at beginning

 

This is where I did wrong.

I tested

images File Directory:

/pub/media/import   NOT correct don't add / at beginning

pub/media/import/  NOT correct don't add / at end

for base  image

/formaten/sub100/100258.png NOT correct no / at beginning

Re: How to organise images when importing cvs into my own structure

Hello @GoodLook ,

 

Method 1: Import Images from the Local Server

  1. On the Magento server, upload the image files to the pub/media/import folder. This is the default folder for importing product images.
    [magento installation folder]/pub/media/import 
    You can use a different folder on the Magento server, as long as the path to the folder is specified during the import process.
  2. In the CSV data, enter the name of each image file to be imported on the correct row, by sku, and in the correct column according to image type (base_image, small_image, thumbnail_image, or additional_images).
    Spoiler
    For images in the default import folder(/pub/media/import), do not include the path before the filename in the CSV data.
    The CSV file must include only the sku column and the related image columns.
    CYGC1.png
  3. Follow the instructions to import the data.
    After selecting the file to import, enter the relative path following Images File Directory:
    /pub/media/import
    SMS9E.png
    If importing multiple images for a single sku, insert a blank row below the sku, and enter the additional image file names in the appropriate columns. The additional rows are understood to belong to the parent sku.

Method 2: Import Images from External Server

  1. Upload the images to be imported to the designated folder on the external server.
  2. In the CSV data, enter the full URL for each image file in the correct column by image type (base_image, small_image, thumbnail_image, or additional_images).
    http://example.com/images/image.jpg
  3. Follow the instructions to import the data.

 

---

If my answer is useful, please Accept as Solution & give Kudos

Re: How to organise images when importing cvs into my own structure

Magento 2.3
the problem is when adding the "/" before the path

 

Follow the instructions to import the data.
After selecting the file to import, enter the relative path following Images File Directory:

 

below path is not working ( when replace and image not correct, the whole SKU is deleted.
When update/replace, error images and no image shows

/pub/media/import 

 

working= no leading slash

pub/media/import 

 

So I just tryed with leading /slash and without. The only way is works is without.

 

Re: How to organise images when importing cvs into my own structure

Leave Images File Directory empty if you are running the import on Magento 2.3.2/2.3.2-p2/2.3.3/2.3.4 versions and files were uploaded into import images base directory - <Magento root folder>/var/import/images.