apps/files_external/3rdparty/Dropbox/API.php
/**
     * Uploads file data from a stream
     * 
     * Note: This function is experimental and requires further testing
     * @param resource $stream A readable stream created using fopen()
     * @param string $filename The destination filename, including path
     * @param boolean $overwrite Should the file be overwritten? (Default: true)
     * @return array
     */
Uploads file data from a stream

This function is experimental and requires further testing
@param resource $stream A readable stream created using fopen()
@param string $filename The destination filename, including path
@param boolean $overwrite Should the file be overwritten. (Default: true)
@return array
Uploads file data from a stream This function is experimental and requires further testing @param resource $stream A readable stream created using fopen () @param string $filename The destination filename including path @param boolean $overwrite Should the file be overwritten . ( Default : true ) @return array
public function putStream($path, $file, $root = null, $overwrite = true)
    {
       	if ($this->isSafeMode) {
       		set_time_limit(600);
       	}
        $path = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($path));
        if (is_null($root)) {
        	$root = $this->root;
        }
        $params = array('overwrite' => (int) $overwrite);
        $this->oauth->setInfile($file);
        $result=$this->oauth->fetch($this->api_content_url . 'files_put/' .
                $root . '/' . ltrim($path,'/'), $params, 'PUT');
        if (!isset($result["httpStatus"]) || $result["httpStatus"] != 200) {
            throw new Dropbox_Exception("Uploading file to Dropbox failed");
        }
        return true;
    }
public function putStream ( $ path , $ file , $ root = null , $ overwrite = true ) { if ( $ this -> isSafeMode ) { set_time_limit ( 600 ) ; } $ path = str_replace ( array ( '%2F' , '~' ) , array ( '/' , '%7E' ) , rawurlencode ( $ path ) ) ; if ( is_null ( $ root ) ) { $ root = $ this -> root ; } $ params = array ( 'overwrite' => ( int ) $ overwrite ) ; $ this -> oauth -> setInfile ( $ file ) ; $ result = $ this -> oauth -> fetch ( $ this -> api_content_url . 'files_put/' . $ root . '/' . ltrim ( $ path , '/' ) , $ params , 'PUT' ) ; if ( ! isset ( $ result [ " httpStatus " ] ) || $ result [ " httpStatus " ] != 200 ) { throw new Dropbox_Exception ( " Uploading file to Dropbox failed " ) ; } return true ; }
Uploads file data from a stream
Uploads file data from a stream