Home>Article>Backend Development> PHP implements file upload and download with the function of displaying files and directories

PHP implements file upload and download with the function of displaying files and directories

墨辰丷
墨辰丷 Original
2018-05-23 14:23:14 3008browse

这篇文章主要介绍了php文件上传及下载附带显示文件及目录功能,需要的朋友可以参考下

主页面wenjianceshi.php

    文件     




返回上一层"; } //遍历目录下的所有文件显示 $arr = glob($fname."/*"); foreach($arr as $v) { $name = basename($v); //从完整路径中取文件名 $name = iconv("gbk","utf-8",$name); if(is_dir($v)) { echo ""; } else { echo ""; } } ?>

显示:

上传处理页面upload.php


      

点击选择文件之后选中了文件会显示:

点击上传即可。

下载处理页面download.php


      

点击下载会弹出下载框,然后进行下载即可。

点击文件夹或者上一层的处理页面chuli2.php


      

以上就是本文的全部内容,希望对大家的学习有所帮助。


相关推荐:

PHP实现获取并生成数据库字典的方法_php技巧

php使用Header函数,PHP_AUTH_PW和PHP_AUTH_USER做用户验证_php技巧

PHP随机数 C扩展随机数_php技巧

The above is the detailed content of PHP implements file upload and download with the function of displaying files and directories. For more information, please follow other related articles on the PHP Chinese website!

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