Closed (fixed)
Project:
FileField
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2008 at 15:36 UTC
Updated:
25 Jan 2011 at 20:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commenteduse the batch api and to avoid timeouts. that's not shown
here's a reasonably generic function to create nodes:
this will help you figure out where the widget wants it's files stored (it should probably become a function in filefield.module):
And here's an example of calling it you'll need to validate then save the files then plug them into the node (I'm doing multiple imagefields) this would be the part that would be a single batch api operation:
Comment #2
drewish commentedComment #3
dirkson commentedAwesome. That's a ton of info, and should serve me well, whenever I get around to actually pulling all these files in. Very high thanks!
Comment #4
grandcat commentedOh, great, also very high thanks. I can need your code to do quite a good integration of ImageField (based on FileField) in Image FUpload (mass uploading via Flash =)
Comment #5
grandcat commentedI used this code to get the suitable validators for my imagefield, but I find it curious that it isn't tested if this is a real image file, not a fake like a renamed PDF, for example. But this seems to be a bug of imagefield, right?
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
mecano commentedWhere is this imagefield_widget_upload_validators function gone? I have not been able to locate such function in last imagefield rev (imagefield-6.x-3.0-alpha2)!
Comment #8
anantagati commentedThank you Drewish. With your help (from #1) was easy to make batch with image upload.
Comment #9
trogie commentedI have been fighting a few days now to find a way to add imagefield files to existing nodes (thus editing). I try to load the node (node_load) add the file array (after the validators and other checking) and submit and save the node...
In fact I'm trying to move my img_attached images on nodes to imagefields without 'destroying' the original images.
Comment #10
greg.harveyWhat format should
$filestake? No matter what I throw at this, the result is the field's array in the node object is totally empty and no files are imported. I can't get this (or any other) approach to work. This *should* be simple, but for some reason I cannot make filefield data stick to a new node in a script at all. It's driving me crazy. =(Comment #11
drewish commentedgreg.harvey $files is an array keyed by the field name with a file (object?) as the value.
Comment #12
greg.harveyThanks drewish! Btw, is there a reference for the Drupal 6.x file object anywhere? I couldn't find one - had to attach a file to a node and vardump the node object to get the structure!
Comment #13
quicksketchgreg.harvey, the $file object is (rather lamely) a direct mapping of the "files" database table.
Comment #14
greg.harveyAh, that's straight-forward enough! Thanks, quicksketch! =)
Comment #15
quicksketchI'm moving this back to closed. I'd highly suggest taking a look at Image FUpload module, which has implemented this method and added a Flash uploading interface for bulk uploads.
Comment #17
davebv commentedIs this code importing just one file to one field or are you able to import several files to one node with a filefield with multiple values?
Comment #20
filoquin commentedIm using this module to import in multiples filefield.