To-many Batch Attachment Uploading

We are in the progress of importing images via a csv mapping file. The mapping includes one to one relations, multiple files to one catNbr, but also one file to multiple catNbrs. I see that the latter disappears in the batch uploader. Am I right that we have to deal with these files prior to uploading (for example split Ma.ex.1014_Ma.ex.139.jpg into two identical files), or is there somthing iI have missed in the tool?

Hi @chrisGNM , great question!

That’s correct, the batch attachment uploader doesn’t support that kind of workflow yet. Creating and uploading a duplicate file with a distinct file name is the only way to upload the image to two separate records in the same upload, but I opened a request on GitHub to change that: Allow matching one file to multiple records in batch attachment uploader · specify/specify7 · Discussion #8659 · GitHub.

It is worth noting that having a single attachment file linked to multiple records in a table (i.e. to the records themselves not through a many-to-one relationship with another table) causes errors in both the “attachments” view and a few standard operations.

I discussed those issues in this thread:

We eventually reuploaded those many-to-one attachment files to their own table and used a many-to-one table relationship instead to sidestep the bugs associated with having attachments linked to more than one record. The process for doing so is here: Linking Attachments via SQL, it’s kind of complicated but I’m sure the Specify team can assist you with it, I am also happy to discuss it with you if you want to know what we did beyond the comments I made in that thread.

I think it makes sense to enable this, but this may require a more comprehensive change to how attachments work under the hood to work without causing errors for users.

Thanks Nate, that is really useful information. For this process, we chose a workflow which included duplicating the images that were related to multiple COs. There were less than 100 of those, so it was no big deal. We will however go forward with more large batch uploads, and then this method will surely prove very valuable!