Hi,

Here is the type of xml file I'm importing via this very nice module :

<document uid="03610970BE4D1D85C12573850055A794">
      <title>My title</title>
      <authors>
        <author>toto</author>
      </authors>
      <body >abcd...</body>
      <files>
        <file>Diaporama.pdf</file>
      </files>
    </document>

I'm now trying to import the file into a field_file which is an attached file field type.
I've made copy of Diaporama.pdf file into sites\mysite\files and try
files//file
into field_file xpath parser settings. When I import I obtain an error:

Download of Diaporama.pdf failed with code -1002.

I suspect it could not be done so simple but does someone have any idea on how to do ??
Thanks in advance for any help.

Comments

norkius’s picture

Any help?
If not maybe anyone can just advise on how to proceed for importing attached files in Drupal?

Thanks a lot!

cees.vanegmond’s picture

Hi,

I suggest using the full path to the file and let drupal / file_field import the file to your file system.
This works for me.

norkius’s picture

Hi!
Thanks to cees.vanegmond for its advise!! Indeed it works fine like that just giving the complete path of the file and let Drupal copying it in its own file repository. Here is the extract of my xml file concerned :

<files>
        <file>E:\work\transfert_files\export\EBD0B8C390D36998C12570A5005152C3\file.pdf </file>
</files>

But in fact at this moment it works only on my windows platform...When I get on a Linux platform I've got the same "failed with code -1002' error for downloading files.
On linux I've made copy of all files into "/var/transfert_files/export"
Now my xml file contains :

<files>
        <file>/var/transfert_files/export/EBD0B8C390D36998C12570A5005152C3/file.pdf</file>
  </files>

I've made all property rights to 777.
Any idea of the problem on linux platform?

Thank you very much for any help!

shiraz dindar’s picture

Norkius, this method worked fine for me (thanks Cees) with a linux path to the source file. Your problem must be some sort of config.

BTW, my XML also had references a Windows path to the file, so I'm use Feeds Tamper to do a search and replace on the field (replacing windows path with the linux path), which may be preferred to a simple search and replace in the xml file.

twistor’s picture

Issue summary: View changes
Status: Active » Closed (fixed)

Closing out old issues. If you're still having this problem, feel free to re-open it.