Home  >  Article  >  Backend Development  >  建立文件交换功能的脚本(三)_PHP

建立文件交换功能的脚本(三)_PHP

WBOY
WBOYOriginal
2016-06-01 12:29:232099browse

//do.php执行上载的文件
当你按下了提交按钮后,文件将会从你的计算机上传到服务器的临时目录下。
在临时目录下的文件名为一个临时文件。应该使用file字段的name值来访问它,在这里为$myfile。
真正的文件名使用file字段的name值加上"_name"来访问它,在这里为$myfile_name。
使用copy()函数,将临时文件$myfile拷贝到指定目录下,拷贝后的文件名为$myfile_name。
完成后不要忘了删除临时文件,不然你会有许多你不想要的文件。
另外你对你指定的目录要有读写权限。在这里是/usr/local/apache/htdocs/file/





保存文件

//3绉
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