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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:50:33
Original
1369 people have browsed it

$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);
Copy after login
Related labels:
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template