Jump to content

Edit History

dirtrider118

dirtrider118

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.

  1. ps_attachment - Details on file name and format
  2. ps_attachment_lang - Attachment name and description to display on front end
  3. 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:

  1. 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".
     
  2. Fill out the attached template and export each tab as CSV. 
    1. 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).
    2. 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".
    3. 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
       
  3. BACKUP ALL 3 TABLES ABOVE BEFORE IMPORTING CSV INTO PHPMYADMIN
     
  4. MAKE SURE ALL 3 TABLES HAVE MATCHING IDs FOR EACH ATTACHMENT AND PRODUCT
     
  5. VOLA!

 

Import-Attachment-Template.xlsx

dirtrider118

dirtrider118

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.

  1. ps_attachment - Details on file name and format
  2. ps_attachment_lang - Attachment name and description to display on front end
  3. 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:

  1. 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".
  2. Fill out the attached template and export each tab as CSV. 
    1. 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).
    2. 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".
    3. 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
  3. BACKUP ALL 3 TABLES ABOVE BEFORE IMPORTING CSV INTO PHPMYADMIN
  4. MAKE SURE ALL 3 TABLES HAVE MATCHING IDs FOR EACH ATTACHMENT
  5. VOLA!

 

Import-Attachment-Template.xlsx

×
×
  • Create New...