如何使用php上传,存档和重命名文件?
|
是否可以使用PHP上传两个不同的文件并以新文件名以zip存档?以下是我创建的表单。
<form action=\"upload.php\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\" id=\"form1\">
<h1>Submit here</h1>
<p>
<label for=\"cat\">category</label>
<select id=\"cat\" name=\"cat\" value=\"\">Category</option>
<option value=\"csr2050\">Cns</option>
<option value=\"npp2023\">npp</option>
</select>
</p><p>
<label for=\"fsheet\">fsheet</label>
<input name=\"fsheet\" type=\"file\" id=\"fsheet\" />
</p><p>
<label for=\"report\">Report</label>
<input name=\"report\" type=\"file\" id=\"report\" />
</p><p>
<input type=\"submit\" name=\"Submit\" id=\"Submit\" value=\"upload\" />
</form>
这就是我想要的,如何编写能够创建所选两个文件的zip存档文件并将其重命名为所选类别值,然后将其上传到/ upload文件夹的upload.php?
没有找到相关结果
已邀请:
1 个回复
荆怖赡
** 压缩 ** 首先从下载zip实用程序类 http://www.phpclasses.org/browse/file/9524.html