<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Insert title here</title> </head> <body> <a href="https://www.jb51.net/article/1.rar">下载1.rar</a> <br /> <a href="https://www.jb51.net/article/1.jpg">下载1.jpg</a> <br /> <a href="doDownload.php?filename=https://www.jb51.net/article/1.jpg">通过程序下载1.jpg</a> <br /> <a href="doDownload.php?filename=../upload/nv.jpg">下载nv.jpg</a> <?php ?> </body> </html> <?php $filename=$_GET['filename']; header('content-disposition:attachment;filename='.basename($filename)); header('content-length:'.filesize($filename)); readfile($filename);
------------------总结-----------------------
<form action="doAction.php" method="post" enctype="multipart/form-data">
<input type="file" /><br/>
二维数组的降维处理;
$_FILES变量
move_upload_file();copy();
tmp_name临时文件;
拓展名的提取;
真实图片的验证;
唯一文件名的生成;
函数封装以及调用;
利用单个文件函数实现多文件上传;
小功能的封装;
多文件的遍历;
面向对象的开发过程;
您可能感兴趣的文章: