日期:2015-06-28 00:00:00 来源: IT猫扑网
直接上代码啦..
- "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- "http://www.w3.org/1999/xhtml" lang="zh-cn">
- "Content-Type" content="text/html; charset=UTF-8" />
- "Content-Language" content="UTF-8" />
- "url" size="20" />
- "submit" type="submit" />
- set_time_limit (24 * 60 * 60);
- if (!isset($_POST['submit'])) die();
- $destination_folder = './downfolde/'; // 文件夹保存下载文件。必须以斜杠结尾
- $url = $_POST['url'];
- $newfname = $destination_folder . basename($url);
- $file = fopen ($url, "rb");
- if ($file) {
- $newf = fopen ($newfname, "wb");
- if ($newf)
- while(!feof($file)) {
- fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );
- }
- }
- if ($file) {
- fclose($file);
- }
- if ($newf) {
- fclose($newf);
- }
- ?>
相关文章
相关下载
网友评论