I'm sure the same logic may work for 1.7 but for my shop on 1.6.1.17 I can confirm the following works. I seen a few other ways but seemed quite complicated and involved modifying core files. Not sure how this works with multi-shops.
If you look at the below three tables you can fill out the data via excel and import the csv into phpMyAdmin for your site.
- ps_attachment - Details on file name and format
- ps_attachment_lang - Attachment name and description to display on front end
- ps_product_attachment - Ties the ID of the attachment to the product ID
!!!!!!!!!!!!!BACKUP ALL 3 TABLES ABOVE BEFORE IMPORTING!!!!!!!!!!!!!
How to import attachments with CSV and assign to product:
-
Place all your files (JPG, ZIP, PDF etc.) into the downloads folder in the main shop directory. In my folder the filenames are encoded without an extension like "be7e7fa051951cf".
-
Fill out the attached template and export each tab as CSV.
- You may notice previously uploaded files added through the back end will show encoded text values under the column "file" in the phpMyAdmin database. For this just match these values to exactly the same as the filenames you uploaded to the download folder (YOURFILENAME.zip).
- Make sure to fill out the mime field. If you are unsure about the value needed, upload the file through the backend and then check the phpMyAdmin ps_attachment database for the latest ID. Your mime type value will be in the mime column such as "application/zip".
-
To get the file sizes I used the following: https://discussions.apple.com/thread/2674721 - cd (drag folder into Terminal window, press return). Then: ls -l > ~/Desktop/list.txt
-
BACKUP ALL 3 TABLES ABOVE BEFORE IMPORTING CSV INTO PHPMYADMIN
-
MAKE SURE ALL 3 TABLES HAVE MATCHING IDs FOR EACH ATTACHMENT AND PRODUCT
- VOLA!