Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid form submission in wordpress

I have a wordpress based classifieds site, i am trying to create and xml feed application that fetches xml from other sites and create ads. I am able to create post in wordpress from the feeds. But i cant copy the images from the remote server,there are no permission issues, i am using the worpress function wp_handle_upload_error, But i get error

This the code

   public function xml_image_upload($upload)
    {
        if ($this->xml_file_is_image($upload['tmp_name'])) 
            {
                $file = wp_handle_upload($upload, $overrides);
            }
    return $file;
    } 

The error i get is "Invalid form submission"

I am trying to solve this for a long time. I cant figure out whats wrong..

like image 937
harikrish Avatar asked Nov 05 '11 11:11

harikrish


1 Answers

You need to pass array('test_form' => FALSE) as the second parameter or the upload will be rejected for some reason. See http://codex.wordpress.org/Function_Reference/wp_handle_upload#Parameters

like image 133
LobsterMan Avatar answered Oct 03 '22 21:10

LobsterMan