Programatically Submitted Form With 'file' Field Throws Notice
ok, why are you not submitting a File (or FID) along with your form_state? I don't understand your problem, because I do this all the time (even with files).

Drupals file widgets usually use like Ajax to upload a file in the background and the form takes a FID in $form_state to process your forms if it has files attached.

When I asked you what the $form_state was I meant:


what are you sending to drupal.
what does drupal typically send as the $form_state when that form is sent through the user interface, because you're just trying to do that programmatically.


I dont think you know the answer to (2) above, because you cant get this to work right. You showed me what you're sending for (1). Here is a tutorial on using Firefox's Firebug plugin to view the submitted POST form state values for a drupal form. You want to drupal_form_submit form state to have the exact same parameters passed to it. In firebug you simply press Persist in the Net tab and you can capture URL requests.

So I'm saying goto the form in the website and submit it using your browser and Firebug to see what it expects to be passed.

You may ask how you get a FID for a file, you simply upload it using php before submitting the form and pass along its $file-&gt;fid. See this community documentation comment here how to do that.

You're just posting a simple HTTP Form, I really doubt Drupal is doing anything wrong.