Bulk Image Upload

Hi, i am trying to replicate site to use the new version instead the old that is very modified whitout support or manteinance.



We have stablished a new political for image files, and want to apply it automated.



We have een imported users and products, also categories and options. Our principal problem is with images I could not understand how CS-Cart works with images.



I have all the product images at /images/detailed/0/ The file name is [product code]-0.jpg for the first image an d -1, -2, -3 for the rest.



I have tried importing images from a csv file modified with the correct URL without results, and no changes if I use import products and change image URL. If I export the prodct and images after import the modified files, I get a csv file with the original data.



The new version of the Cs-Cart is now a trial version, but the original one is a lifetime licensed one.



Any suggestions??

[quote]

I have tried importing images from a csv file modified with the correct URL without results, and no changes if I use import products and change image URL. If I export the prodct and images after import the modified files, I get a csv file with the original data.

[/quote]

Not quite sure what you're saying. You'd have to provide a concrete example of what you import and what you expect.



Note that cs-cart uses the decimal value of the sub-directory (images/detailed/0) as a factor of the constant defined in config.local.php called MAX_FILES_IN_DIR. It places the files in the proper subdirectory upon import or upload based on the image_id assigned in the database to the image.



I.e. if you had MAX_FILES_IN_DIR defined as 1000 (default) and you had an image_id of an image of 3024, it would be placed in the images/detailed/3 directory (int_val(3024 / 1000 )== 3) when you import or upload it. It maintains the name you give it. If you have less than 1000 images then they'd all be in the 0 sub-directory.



You should not be importing FROM /images/detailed/0 but instead more than likely from /var/files/0 (the decimal here relates to the company_id). But you can use any location if you use a fully-qualified path name starting at the root of your server (typically for example /home/[cpanel_user]/public_html/var/files/0/abcdef-0.jpg).



I probably wouldn't use a URL in the path of a csv. It will be really slow since you will have to invoke a new instance of Apache/PHP for each file and it's all local anyway.

The problem is … the csv file do not change nothing at CS-Cart. If i change configuration in csv file and change for example the image file name for a product, the result is that no changes at cS-Cart, if I test, the product still has the old file name for the image, and of course loads the old file.

Do you have any special characters in the name or the 'alt' specification for the image?

Unfortunately cs-cart is generally silent about import errors/issues.



Again, if you provided an actual line of your CSV it might help us help you.

Ok, I will resume that:



I reuploaded all the images to “public_html/v5/var/files/1/exim/backup” after that I import a csv file wth this info:



“AA9”;“M”;“”;“exim/backup/images/aa9-1.jpg#{[de]:;[en]:;[es]:;[fr]:;}”



After that, the prouct image still points to “aa9-0.jpg”

Get rid of the exim/backup/images in your csv if you have it already set in “Images directory”. Otherwise it's going to look for the path exim/backup/images/exim/backup/images/aa901.jpg

Still the same issue, with the revious path and whiout it.



I use HostGator, is possibe I need to configure some php function or switch to allow that?

Can only guess and it's not worth doing so. Have you tried using a full path t the image? I.e.

/home/my_cpanel_user/public_html/var/files/0/exim/backup/images/aa901.jpg



And have you reviewed your error_log to be sure you're not gettting any “File not found” messages?

Hi Artes, just checking on this issue. Sorry to bump this up but how were you able to fix this? WOuld be nice if you can share the quick steps too. :) 1.gif