public function putFile($file, $filename = false, $path = '', $overwrite = true)
    {
        if (file_exists($file)) {
            if (filesize($file) <= 157286400) {
                $call = 'files/' . $this->root . '/' . $this->encodePath($path);
                // If no filename is provided we'll use the original filename
                $filename = (is_string($filename)) ? $filename : basename($file);
                $params = array(
                    'filename' => $filename,
                    'file' => '@' . str_replace('\\', '/', $file) . ';filename=' . $filename,
                    'overwrite' => (int) $overwrite,
                );
                $response = $this->fetch('POST', self::CONTENT_URL, $call, $params);
                return $response;
            }
            throw new Exception('File exceeds 150MB upload limit');
        }
        
        // Throw an Exception if the file does not exist
        throw new Exception('Local file ' . $file . ' does not exist');
    }
public function putFile($file, $filename = false, $path = '', $overwrite = true)
    {
        if (file_exists($file)) {
            if (filesize($file) <= 157286400) {
                $call = 'files/' . $this->root . '/' . $this->encodePath($path);
                // If no filename is provided we'll use the original filename
                $filename = (is_string($filename)) ? $filename : basename($file);
                $params = array(
                    'filename' => $filename,
                    'file' => '@' . str_replace('\\', '/', $file) . ';filename=' . $filename,
                    'overwrite' => (int) $overwrite,
                );
                $response = $this->fetch('POST', self::CONTENT_URL, $call, $params);
                return $response;
            }
            throw new Exception('File exceeds 150MB upload limit');
        }
        
        // Throw an Exception if the file does not exist
        throw new Exception('Local file ' . $file . ' does not exist');
    }
public function putFile ( $ file , $ filename = false , $ path = '' , $ overwrite = true ) { if ( file_exists ( $ file ) ) { if ( filesize ( $ file ) <= 157286400 ) { $ call = 'files/' . $ this -> root . '/' . $ this -> encodePath ( $ path ) ; // If no filename is provided we'll use the original filename
 $ filename = ( is_string ( $ filename ) ) ? $ filename : basename ( $ file ) ; $ params = array ( 'filename' => $ filename , 'file' => '@' . str_replace ( '\\' , '/' , $ file ) . ';filename=' . $ filename , 'overwrite' => ( int ) $ overwrite , ) ; $ response = $ this -> fetch ( 'POST' , self :: CONTENT_URL , $ call , $ params ) ; return $ response ; } throw new Exception ( 'File exceeds 150MB upload limit' ) ; } // Throw an Exception if the file does not exist
 throw new Exception ( 'Local file ' . $ file . ' does not exist' ) ; }
Uploads a physical file from disk
Dropbox impose a 150MB limit to files uploaded via the API. If the file
exceeds this limit or does not exist, an Exception will be thrown
@param string $file Absolute path to the file to be uploaded
@param string|bool $filename The destination filename of the uploaded file
@param string $path Path to upload the file to, relative to root
@param boolean $overwrite Should the file be overwritten? (Default: true)
@return object stdClass
Uploads a physical file from disk Dropbox impose a 150MB limit to files uploaded via the API . If the file exceeds this limit or does not exist an Exception will be thrown