Jump to content

Importing mass attachment files


GameOver

Recommended Posts

Hello,

 

I've made a migration from OSC to Prestashop (latest version).

Each product in OSC have a link to a pdf file. I want to import this file into attachment table of prestashop. I'm looking for a mods or a php sample to import that into this table but I don't how to encryt the field named "File" in the Attachment table.

 

Help needed

 

Thanks a lot

Link to comment
Share on other sites

The process is in the postProcess() function in the file /admin/tabs/AdminAttachment.php, and also in the postProcess() function of /admin/tabs/AdminProducts.php.

 

What it does is it takes the name of the attachment, uses sha1() function to create a unique filename from the timestamp and then stores the name in the file column. The real filename is stored in the file-name column.Don't forget to set the mime column to the mime type of the file because that is how the download is correctly handled by the user's browser.

 

The attachment.php file in the root, handles the downloading.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...