UpYun::readFile PHP Method

readFile() public method

下载文件
public readFile ( string $path, mixed $file_handle = NULL ) : mixed
$path string 文件路径
$file_handle mixed
return mixed
    public function readFile($path, $file_handle = NULL)
    {
        /*{{{*/
        return $this->_do_request('GET', $path, NULL, NULL, $file_handle);
    }

Usage Example

Exemplo n.º 1
0
 public function getFileContent($filename)
 {
     $filename = trim($filename);
     $config = $this->getConfig();
     tsload(ADDON_PATH . '/library/upyun.class.php');
     $cloud = new UpYun($config['cloud_attach_bucket'], $config['cloud_attach_admin'], $config['cloud_attach_password']);
     $cloud->setTimeout(60);
     $content = $cloud->readFile('/' . $filename);
     if (!$content) {
         $this->error = '读取云附件失败!';
         return false;
     } else {
         return $content;
     }
 }
All Usage Examples Of UpYun::readFile