I've used feeds before to import images to an imagefield using the Xpath parser, and everything worked fine. Simply retrieving an image URL and mapping it to an Imagefield creates the images.

I'm now trying to do the same thing using the CSV parser but I'm getting an error in the watchdog for every file:

Cannot write content to /tmp/img-lr-281-051-001.jpg

Permissions are set correctly on the directory.

As a test I created a cck text field and mapped the column containing the image URLs in the CSV file to this field, and the import creates a perfectly valid URL for each image in the cck text field. So Im a bit puzzled as to what might be wrong.

Anyone got any ideas?

Comments

Toxid’s picture

+1

ivan zugec’s picture

Status: Active » Fixed

Found a workaround. :) The issue is we are passing feeds a string when it needs an array of image urls. Use feeds_tamper module (http://drupal.org/project/feeds_tamper) and Explode a comma separated image urls in an array.

This way your passing the filefield mapper an array of URLs instead of a string. Worked for me.

problue solutions’s picture

I solved this a while ago and I honestly cant remember how :|

Thanks for this Ivan, I'm sure I will encounter this again and your method will no doubt save me a lot frustration trying to retrace my steps! :)

Status: Fixed » Closed (fixed)

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

Michsk’s picture

@Ivan: how did you fix this with feeds tamper? I'm trying it now but can't get it done. I have one value:

<?php
<img_large><![CDATA[http://static.site.nl/data/producten/img-big.jpg]]></img_large>
?>

I set the tamper to explode the list with a , but it doesn't do it. I keep getting the cannot write content error.

Michsk’s picture

Seems i had safemode turned on. Turning off safe_mode fixed this for me.

Michsk’s picture

mm phpinfo shows my safe_mode is off but i still get this error. Not always tough, i can't really figure out when it works and when it doesnt

velpan’s picture

Component: Feeds Import » Code

I got the same error due to a typing error in the filename of image. So check this too.

velpan’s picture

Issue summary: View changes

typo