3

I try to use Node Import clone with an extra image field to import nodes with images attached.

Without success, I try to upload content from a local file (s).

I use CSV parser and Node Processor. My content type has a image field called Photo I mapped to the csv format using the mapper.

I am using Windows as a local feeds source and Drupal 7 as a server.

How to import images using CSV Node Import ? What should be exactly the image file path in the csv file ?

6
  • I use the latest dev of feeds module, Drupal 7.10 and I got error "Download of C:\file.jpg failed with code -1003."
    – LLub
    Commented Jan 2, 2012 at 16:27
  • Any reason you don't want to use drupal.org/project/migrate?
    – uwe
    Commented Jan 2, 2012 at 21:14
  • Your question mentions CSV parser and Node Parser. Are you referring to "Feeds Self Node Processor"? If so, it has not been updated since February. Are you sure the module is working correctly?
    – Ashlar
    Commented Jan 2, 2012 at 22:08
  • @MotoTribe the reason I'd prefer to use Feeds is that there is no UI for the Migrate module or at least I am not aware of any UI for setting up Migrate scripts.
    – LLub
    Commented Jan 8, 2012 at 7:55
  • @Ashlar , no, I didn't refer to Feeds Self Node Processor. I referred to Feed 4 edit options: Basic settings, Fetcher, Parser, Processor.
    – LLub
    Commented Jan 8, 2012 at 7:58

3 Answers 3

3

I don't think it will work based on local files. The way I understand it, feeds is made to work off CSV data, with files that are already on the server.

It will take a bit of playing around on your part, but your best bet is to upload a single product/node with an image. Find the path to that image. Once you find the folder where your image is being stored, upload your images to that folder.

Then give the direct path to the image on your server in your CSV file, in the image section. The path will probably look something like this, depending on the how you configured the image field. This example is from a Drupal Commerce site:

example.com/sites/default/files/styles/uc_product_big/public/image-you-want-to-use.jpg

If your server runs some sort of post processing (image-resizing, cropping, scaling), and then saves in multiple folders, I'm afraid you're out of luck with this method.

0
0

I am not entirely clear on what you are doing, but I had similar problems trying to read a text file in a custom module. Any file used in Drupal must be imported using drupals api using file_save_upload or file_save ( I believe this puts the files in the database for handling by Drupal). These files are saved within the Site directory structure (your download error message suggests yours are not). You may want to check the modules you are using to see if Drupal is saving the file. This process is necessary because browsers do not let outside sites access a users files without their permission.

0

To extend upon commercebythegradeo's answer. There's a module available called:

Feeds Image Grabber
https://drupal.org/project/feeds_imagegrabber

What this module does is allow you to import the specified image from the URL into the node, rather than simply referencing it. This way all your post processing can be one, which as I see it was the only real flaw in the answer provided by commercebythegradeo.

1
  • This only works for HTML, not XML.
    – gagarine
    Commented Feb 2, 2015 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.