Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By cburschka on
To wit: Is there any way to do this?
I am implementing a bulk upload feature, where a user should be able to create dozens of image nodes at once by uploading a zip archive with a text file full of meta data. I've gotten as far as parsing the file, populating the node form, calling it with drupal_execute...
But the imagefield refuses to accept a local file as an upload, no matter what I try. As the field is marked as required, I can't even work around it by manually adding the file to the database.
Comments
Try
You can use hook_form_alter() to remove the 'required' flag from the image field. Then your approach should work.
It may not apply directly, but I used a similar approach in the MySite module. To grab icons for representing RSS feeds, I grab the feed icon and save it to disk.
See http://therickards.com/api/function/mysite_type_feed_image/MySite.
--
http://ken.blufftontoday.com/
http://new.savannahnow.com/user/2
Search first, ask good questions later.