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

dawnbuie’s picture

OK - 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:

<Attached-files>http://site.com/sites/default/files/info_request.pdf</Attached-files>
<Attached-files>http://site.com/sites/default/files/prosperity_eis_sufficiency_submissions_dec_6.pdf</Attached-files>

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

<files>
<Attached-files>http://site.com/sites/default/files/info_request.pdf</Attached-files>
<Attached-files>http://site.com/sites/default/files/prosperity_eis_sufficiency_submissions_dec_6.pdf</Attached-files>
</file>

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!

dawnbuie’s picture

OK 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.

dawnbuie’s picture

Issue summary: View changes

clarification, simplified wording

kenorb’s picture

Issue summary: View changes
Status: Active » Fixed

As per #2.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.