Home >Backend Development >PHP Tutorial > php怎么上传一个压缩文件?给个实例吧

php怎么上传一个压缩文件?给个实例吧

WBOY
WBOYOriginal
2016-06-13 12:46:15864browse

php如何上传一个压缩文件?给个实例吧
从网上找了一个 不知道我错在了哪里 而且没有指定上传到哪里

表单部分

<br />
<form enctype="multipart/form-data" action="singleupload.php" method="post"> <br />
    <input type="hidden" name="MAX_FILE_SIZE" value="2000000"> <br />
    <input type=file name=upfile size=20> <br />
    <input type=submit value="上传文件"><br />
</form><br />



singleupload.php
<br />
if (move_uploaded_file($_FILES['upfile']['tmp_name'], $_FILES['upfile']['name'])) {<br />
    echo "<h2><font color=#ff0000>文件上传成功!</font></h2><br><br>"; <br />
}else { <br />
    echo "<h2><font color=#ff0000>文件上传失败!</font></h2><br><br>"; <br />
}<br />

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