[development] create nodes with attached files using drupal_execute

Darren Oh darrenoh at sidepotsinternational.com
Wed Nov 14 23:06:12 UTC 2007

Have you added this line to your form?
$form['#attributes']['enctype'] = 'multipart/form-data';

On Nov 14, 2007, at 5:18 PM, Isaac Simon Hodes wrote:
> Hello, I’m new to the forms API and hoping for some advice. I am  
> creating a multistep form in 5.3. The form uses drupal_execute to  
> generate new CCK nodes. The basic form is working, but I cannot  
> figure out how to make drupal_execute attach files to the new nodes  
> as it creates them.
> I would like to simply pass a form value to the CCK node form  
> (through drupal_execute) along with the other necessary fields.  
> E.g. something along the lines of
> $values['file']['field_object_file_upload'][0] = $form_values 
> [‘my_form_file_upload_field’];
> Solutions involving either upload module or a CCK file field would  
> be fine.
> Does anyone have advice?  (I hope this is an appropriate question  
> for the “development” list. Based on the descriptions at  
> lists.drupal.org  that seems to be the case; if not, please let me  
> know where I should post it.) Thanks for your help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20071114/98e45bda/attachment.htm 

More information about the development mailing list