Bulk upload to custom module: picture associations

Posted by Community Admin on 04-Aug-2018 02:01

Bulk upload to custom module: picture associations

All Replies

Posted by Community Admin on 04-Dec-2012 00:00

I have created a custom module that includes images, along with short and long text fields. I've seen examples on using code to create data items within some of the existing modules, including uploading pictures to the photo library, but I'm not sure how to upload a picture and have it link to a record in my custom module. Looking at the tables created for the module in SQL, I see one table for the data, and one table each for each of the image fields (there are three) that has the GUID for the data item and the GUID for the picture in a many-to-many type relationship. 

What I would like to be able to do is iterate through a .csv that contains all of the data for the content type, as well as paths to the images, create each of the items and link them to the pictures. I have about 400 items to create, so doing it by hand is not an inviting prospect. I was hoping someone could point me in the right direction of establishing the link between the pictures and the data item.

Thanks,
Stuart

This thread is closed