using external images to display images in a folder

WP Intense Q & ACategory: External Imagesusing external images to display images in a folder
dean s asked 3 weeks ago

hi

i have a presale question. i have over 5000 photos for all my products on my site (i have around 2.5k products plus variations) on my cdn all the images are in folders which are named exactly as the sku. is there a way i can link the folders to product gallery so it shows those pictures inside that folder or will i have to specify the url of each image?

the problem i am having is if i am not able to link the folder to show the photos i will have to create a csv with a link to all the seperate images which will be very time consuming. what is the best way to tackle this issue?

thanks

2 Answers
Dave Hilditch Staff answered 2 weeks ago

The CDN will be configured with HTTP not FTP, so it won’t be possible to list the contents of the folders.

Instead, you can quickly generate a CSV file for your folder structure. If you can SSH to your CDN, then you can use some linux commands:

https://unix.stackexchange.com/questions/208499/get-a-csv-file-containing-names-of-files-within-a-directory

Otherwise, you can download your images to your local computer and then use a command on your computer to generate the list of folders (SKUs) to files:

https://superuser.com/questions/744677/create-xls-or-csv-from-file-names-in-folder-on-windows

Once you have this info in a text file, you can use Excel or Google Sheets to pick out the SKU from the folder name into a separate column and concatenate the image names into a single row.

Presumably you have some process that’s actually depositing these images into these folders? Maybe you can tap into that process and have it also write rows to a CSV file, one row per SKU with pipe separated image paths.

Let me know if you need further help with this.

Dave Hilditch Staff answered 2 weeks ago

The CDN will be configured with HTTP not FTP, so it won’t be possible to list the contents of the folders.

Instead, you can quickly generate a CSV file for your folder structure. If you can SSH to your CDN, then you can use some linux commands:

https://unix.stackexchange.com/questions/208499/get-a-csv-file-containing-names-of-files-within-a-directory

Otherwise, you can download your images to your local computer and then use a command on your computer to generate the list of folders (SKUs) to files:

https://superuser.com/questions/744677/create-xls-or-csv-from-file-names-in-folder-on-windows

Once you have this info in a text file, you can use Excel or Google Sheets to pick out the SKU from the folder name into a separate column and concatenate the image names into a single row.

Presumably you have some process that’s actually depositing these images into these folders? Maybe you can tap into that process and have it also write rows to a CSV file, one row per SKU with pipe separated image paths.

Let me know if you need further help with this.

Black Friday!

This is the only time of year when we have our biggest discount ever!

Use coupon code BF2020 for a massive 50% discount.

We use cookies

We use cookies for various things on our site, including our on-site chat bubble (if you use it), our comment forms (if you use them) and for session handling (if you log in).

Other than that, we use cookies to identify where traffic came from to help us understand which traffic turns into sales, we use a cookie for Google Analytics traffic analysis and we use a cookie to customise adverts for our own products we think you'll be interested in.

You can read more detail in our privacy policy page. Please click 'Accept' or 'Decline' to continue.