Hi - I want to split a comma separated list of absolute path files into separe file attachements on an imported node.
My XML source file:
<files>http://site.com/files/aa.pdf,http://site.com/files/ba.pdf, http://site.com/files/ca.pdf</files>
In XPath Parser settings I've assigned 'files' to my file_field. I then added the 'explode' filter to the file_field in the Tamper settings.
This ALMOST works. I get the first file downloaded and associated with my content correctly, but if there is more than one associated file - the first file gets added that many more times. So if there are 3 files in total I get the first file aa.pdf, repeated 3 times.
thank you in advance for any advice on how to debug.
Comments
Comment #1
dawnbuie commentedOK - I've trying all sorts of variations and can to get past importing and associating only one file per new node. As well I cannot get Feeds Image Grabber to work with Feeds XPath parser at all. Text fields work fine. It's too bad because this is such a wonderfully flexible module - but what I need to do is bring over inline images and attached pdf files.
I hope there is a fix for this - I'm wondering if other people have had success importing more than one associated file per node?
I was trying to explode a comma separated list - as I said above. Then out of curiosity I wonder if I could get download and associate the file with my node if the source XML was more conventional. So I edited a sample XML file splitting the associated files into 2 separate tags:
That didn't work - the 2 files do get downloaded into the correct directory however only the last file in the list is associated with the node.
When I tried the nested approach
referring to it in the parse as 'files/Attached-files' - that did work!
Great! - except, there is no Drupal 6 module I know of that will output Attached files in this manner as an XML output. I've been using Data Export module, and that's where I got the comma separated output. And I still think comma separated data, exploded, should work!
Comment #2
dawnbuie commentedOK I was getting files downloaded, then I deleted everything and tried again - and I'm getting files downloaded but not attached to the originating node.
Then I shut down my browser and tried again and it worked! Now I just have to find a way to get Data Export Views to output nested attached file XML tags. So far I haven't had any luck there either.
Comment #2.0
dawnbuie commentedclarification, simplified wording
Comment #3
kenorb commentedAs per #2.