文件上传值并非为所有值传递:
print_r($_FILES);
返回:
Array ( [file] => Array (
[name] => IMG_20150905_160429690.jpg
[type] => [tmp_name] => [error] => 1 [size] => 0 ))
这是我的HTML:
<form form action="profilepic_original_photo.php" method="post" enctype="multipart/form-data" class="form-horizontal" style="margin-top: 20px;">
<div class="form-group">
<label class="control-label col-xs-3">File Upload</label>
<div class="col-md-9">
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="input-append">
<div class="uneditable-input">
<!--<i class="fa fa-file fileupload-exists"></i>-->
<span class="fileupload-preview"></span>
</div>
<span class="btn btn-default btn-file">
<span class="fileupload-exists">Change</span>
<span class="fileupload-new">Select file</span>
<input type="file" name="file" required>
</span>
<a href="#" class="btn btn-default fileupload-exists" data-dismiss="fileupload">Remove</a>
</div>
</div>
</div>
</div>
</form>
答案 0 :(得分:1)
好吧,[error] => 1
,http://php.net/manual/en/features.file-upload.errors.php说:
价值:1;上传的文件超出了php.ini
中的upload_max_filesize指令