file upload using Webservice I am using Drupal 7 and trying to upload a file 

function upload_service_menu() {
  $items = array();

  $items['api/v1/upload'] = array(
    'title' =&gt; 'File Upload Service',
    'description' =&gt; 'Upload files to public directory on this server',
    'page callback' =&gt; 'upload_service_job',
    'access arguments' =&gt; array('access content'),
    'type' =&gt; MENU_CALLBACK,
  );
  return $items;
}

/**
 * Function to get the path, download and store the file on our server.
 */
function upload_service_job() {

    $file = $_FILES;

    $validators = array();
    $file = file_save_upload($file, $validators, 'public://');
    if($file){
        echo "Sucess";
    }else {
        echo "fail";
    }
}


and my local form is 

&lt;form action="http://example.com/api/v1/upload/" method="post"
enctype="multipart/form-data"&gt;
&lt;input type="file" name="file" id="file"&gt;&lt;br&gt;
&lt;input type="submit" name="submit" value="Submit"&gt;
&lt;/form&gt;


But i am not able to upload file. Seems file_save_upload($file, $validators, 'public://'); function is not working .I checked permissions also.. 
Can anybody tell me what to do.  

Thanks
$_FILES is


  An associative array of items uploaded to the current script via the HTTP POST method.


file_save_upload() takes as its first parameter


  A string specifying the filepath or URI of the uploaded file to save.


Your code essentially does this

$file = file_save_upload($_FILES, $validators, 'public://');


So you're currently passing an array to a function that's expecting a string. 

You're probably looking for something along the lines of

$file = file_save_upload($_FILES['file']['name'], $validators, 'public://');