XML Importer with upload field
This is an open discussion with 2 replies, filed under Troubleshooting.
Search
Did you find a solution?
bzerangue apparently got this to work with the regular upload field this post and the following ones.
Create an account or sign in to comment.
Has anybody ever used the XML importer on a section that contains a upload field? I am currently trying to import a couple of files into said section but can't seem to make it work.
My first try consisted of simply passing the filename to the field as if it was a textfield:
concat('/uploads/bilder/', filename/text())
as the XPath expression. The data was going to the right MySQL table but it was missing all the metadata (mimetype, size and file creation metadata).Nick hinted at "the field accepts strings and arrays, maybe try the latter" so I introduced a new function to the importer file and applied it to the upload field values:
But this failed as the upload field was complaining about the file already existing. Moving all files to a different directory didn't help though.
I tried overriding the uploadfield's "file exists"-check but the data didn't end up in the table at all, not a single line was added.
So my question remains: has anybody tried to import data into upload fields before?
P.S. I'm using the unique upload field but was overriding it's special filename treatment for my experiments.