As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Attachments can be added when creating documents from "Files tab", i want to do the same thing using a CSV file so i wonder what should I add as a property that refers to attachments in the CSV file. I'm able to add the Main File using "file:content" property , I've tried to add "files:file:content" but it's not working. Any idea about this ?
I'm not sure to understand your question, but the "files" schema does not work like the "file" schema. "file" does have two attributes named filename and content, but files does not. It contains a list of items names files, with each item having two attributes
Thank you [Greg Drayon](https
Short answer: after a closer look to the CSV Import bundle, in the CSVImporterWork class, there doesn't seem to have any way to handle another blob proeprty than the "file:content" one or, at least, one which is not part of a list or complex type property and still named "content".
Explanation (but I might be wrong): "files:files" is an array property, so should be handled as such in the CSV file. So, it SHOULD be something like: Header: files:files In the CSV line: "[{"filename":"name for file 1","file":"file1.pdf"},{"filename":"name for file 2","file":"file2.docx"}]"
This is how it SHOULD be, from my understanding on how it works. As it is an array property, it would be handled by the "fieldType.isListType()" part, and then handled as a simple array, and not an array which could contain blobs to handle. I tried the line I give before and I get an exception:
java.lang.ClassCastException: org.codehaus.jackson.node.TextNode cannot be cast to org.codehaus.jackson.node.ObjectNode at org.nuxeo.ecm.automation.core.util.ComplexTypeJSONDecoder.decode(ComplexTypeJSONDecoder.java:121)
It means that the program tries to use a string as an object. So it does evaluate the "file":"file1.pdf" as if it would be for a string property, not a blob.
As it is right now, I'm not sure the CSV importer can handle your case, except by modifying it.
Okay, thank you so much [Greg Drayon](https
Note that file
Thank you for the update. My knowledge might be a little bit outdated.