Importing attachments together with CSV data into products

Fabio Goto asked on August 30, 2018 22:38

Hi!

By following this guide here: https://docs.kentico.com/k11/e-commerce-features/configuring-your-store/configuring-products/importing-products/importing-products-using-api, together with other resources, I was able to build a file uploader and parser for CSV files, so I can import batches of products.

The problem is: most of these products need a PDF data sheet as an attachment. How can I import these files as attachments, together with the CSV data?

Thanks! :)

Recent Answers


Zach Perry answered on August 30, 2018 22:48

I would have a column in your CSV with a filename or path to a file, then when you are creating the product, you create the attachment.

Here is the api for attachemtns.

0 votesVote for this answer Mark as a Correct answer

Fabio Goto answered on August 31, 2018 19:43

Thanks, Zach!

Yeah, I'll have to read that API thingy and try to get the best out of it then. The importer I built was the first piece of proper C# code I wrote and was kinda surprised it worked. 😅

Let's see if I can do this then. This job kinda landed on my lap because no one was able to do it properly, but I'm mostly a PHP developer, so it's kinda a struggle. 😆 For beginner's luck, it's working and got approved. ✨

Thanks again!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.