function postFile($action,$file,$params = array(),$options = array()){
		if(is_string($file)){
			$file = array("path" => $file);
		}

		$file += array(
			"path" => "", // "/path/to/file/photo.jpg"
			"postname" => null, // "image"
			"name" => null, // "photo.jpg"
			"mime_type" => null, // "image/jpeg"
		);

		if(!$file["name"]){
			$file["name"] = preg_replace('/^.*\//','',$file["path"]); // "/params/to/image.jpg" -> "image.jpg"
		}

		if(is_null($file["mime_type"])){
			$file["mime_type"] = Files::DetermineFileType($file["path"]);
		}

		$options["method"] = "POST";
		$options["file"] = $file;

		return $this->_doRequest($action,$params,$options);
	}
function postFile($action,$file,$params = array(),$options = array()){
		if(is_string($file)){
			$file = array("path" => $file);
		}

		$file += array(
			"path" => "", // "/path/to/file/photo.jpg"
			"postname" => null, // "image"
			"name" => null, // "photo.jpg"
			"mime_type" => null, // "image/jpeg"
		);

		if(!$file["name"]){
			$file["name"] = preg_replace('/^.*\//','',$file["path"]); // "/params/to/image.jpg" -> "image.jpg"
		}

		if(is_null($file["mime_type"])){
			$file["mime_type"] = Files::DetermineFileType($file["path"]);
		}

		$options["method"] = "POST";
		$options["file"] = $file;

		return $this->_doRequest($action,$params,$options);
	}
function postFile ( $ action , $ file , $ params = array ( ) , $ options = array ( ) ) { if ( is_string ( $ file ) ) { $ file = array ( "path" => $ file ) ; } $ file += array ( "path" => "" , // "/path/to/file/photo.jpg" "postname" => null , // "image" "name" => null , // "photo.jpg" "mime_type" => null , // "image/jpeg" ) ; if ( ! $ file [ "name" ] ) { $ file [ "name" ] = preg_replace ( '/^.*\//' , '' , $ file [ "path" ] ) ; // "/params/to/image.jpg" -> "image.jpg" } if ( is_null ( $ file [ "mime_type" ] ) ) { $ file [ "mime_type" ] = Files :: DetermineFileType ( $ file [ "path" ] ) ; } $ options [ "method" ] = "POST" ; $ options [ "file" ] = $ file ; return $ this -> _doRequest ( $ action , $ params , $ options ) ; }
Sends a single file into the specific action

$api_data_fetcher->postFile("images/create_new","/path/to/file.jpg");

$api_data_fetcher->postFile(
"images/create_new",																																					// action name
array("path" => "/path/to/file.jpg", "name" => "earth.jpg", "mime_type" => "image/jpeg"),	// file definition
array("title" => "Image of Earth", "description" => "...")																		// other parameters
);

$api_data_fetcher->postFile("images/create_new","/path/to/file.jpg",array("title" => "Image of Earth", "description" => "..."));
Sends a single file into the specific action