[英]When creating a user file upload button how can I choose the folder in which I want the file to be uploaded?
<div class="fileupload">
<button class="button">+</button>
<input type="file" name="myfile" id="filebutton"
accept="image/png" enctype="multipart/form-data"/>
</div>
为了选择用户上传的文件在代码文件夹中的保存位置,我应该在代码中添加什么属性。
按照本教程,使用 PHP 您可以这样做:
$dest=__DIR__.'/uploads/'.$upload_file_name;
并用任何你想要的替换路径。
(此代码来自The complete PHP script so far section)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.