apps/files_external/3rdparty/Dropbox/API.php
/**
     * Creates and returns a shareable link to files or folders.
     *
     * Note: Links created by the /shares API call expire after thirty days.
     *
     * @param string $path
     * @param string $root      Use this to override the default root path (sandbox/dropbox)
     * @param string $short_url When true (default), the URL returned will be shortened using the Dropbox URL shortener
     * @return array
     */
Creates and returns a shareable link to files or folders.

Links created by the /shares API call expire after thirty days.

@param string $path
@param string $root      Use this to override the default root path (sandbox/dropbox)
@param string $short_url When true (default), the URL returned will be shortened using the Dropbox URL shortener
@return array
Creates and returns a shareable link to files or folders . Links created by the / shares API call expire after thirty days . @param string $path @param string $root Use this to override the default root path ( sandbox / dropbox ) @param string $short_url When true ( default ) the URL returned will be shortened using the Dropbox URL shortener @return array
public function share($path, $root = null, $short_url = true) {
        if (is_null($root)) $root = $this->root;
        $path = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($path));
        $short_url = ((is_string($short_url) && strtolower($short_url) === 'false') || !$short_url)? 'false' : 'true';
        $response = $this->oauth->fetch($this->api_url.  'shares/'. $root . '/' . ltrim($path, '/'), array('short_url' => $short_url), 'POST');
        return json_decode($response['body'],true);
    }
public function share ( $ path , $ root = null , $ short_url = true ) { if ( is_null ( $ root ) ) $ root = $ this -> root ; $ path = str_replace ( array ( '%2F' , '~' ) , array ( '/' , '%7E' ) , rawurlencode ( $ path ) ) ; $ short_url = ( ( is_string ( $ short_url ) && strtolower ( $ short_url ) === 'false' ) || ! $ short_url ) ? 'false' : 'true' ; $ response = $ this -> oauth -> fetch ( $ this -> api_url . 'shares/' . $ root . '/' . ltrim ( $ path , '/' ) , array ( 'short_url' => $ short_url ) , 'POST' ) ; return json_decode ( $ response [ 'body' ] , true ) ; }
Creates and returns a shareable link to files or folders.
Creates and returns a shareable link to files or folders .