在我的index.php文件中,我得到了一个代码是跟踪$_file,但似乎在上传pic/jpeg/images文件时,返回结果是"array(0){}"。我需要使用smarty的方法来分配输入文件的方法吗?
var_dump($_FILES);
我的照片上传.tpl
<form action="index.php?view=photoupload" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file">
<input class="btn_name" type="submit" name="submit" value="Submit">
</form>
不,你不必这么做,这是我当前项目的一部分,我与smarty合作:
<form action="upload_contract.php" enctype="multipart/form-data" method="post">
...
<div class="row">
<div class="large-5 columns">
<label for="upload">Dateiupload:</label><span><input type="file" id="upload" name="upload"></span>
</div>
</div>
这一个在没有其他方法的情况下运行良好。