Home >Backend Development >PHP Tutorial >下载文件 readFile 这个函数怎么用?

下载文件 readFile 这个函数怎么用?

WBOY
WBOYOriginal
2016-06-06 20:50:331323browse

$upyun = new UpYun('xxx', 'xxx', 'xxx');
$upyun->readFile('/uploads/11/file_1365168728_szd.rar');

这个函数怎么用

回复内容:

$upyun = new UpYun('xxx', 'xxx', 'xxx');
$upyun->readFile('/uploads/11/file_1365168728_szd.rar');

这个函数怎么用

两个用法 ...

// $data 即为文件内容
$data = $upyun->readFile('/temp/upload_demo.png');

// 读取文件并写入本地的 /tmp/demo.png
$fh = fopen('/tmp/demo.png', 'w');
$upyun->readFile('/temp/upload_demo.png', $fh);
fclose($fh);
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn