我正在尝试将文件/图像上传表单添加到我的网站,但是出现以下错误
Unexpected field 'uploadfile' in POST data, Missing field 'uploadfile.name, uploadfile.type, uploadfile.tmp_name, uploadfile.error, uploadfile.size' in POST data
使用以下表单代码
<?= $this->Form->create(null, ['id' => 'save_upload_image', 'url' => "/research_station/save_upload_image", 'class' => 'upload-file']) ?>
<div class="form-group">
<?= $this->Form->control('uploadname', ['id' => 'uploadname']) ?>
</div>
<div class="form-group">
<?= $this->Form->file('uploadfile', array('name' => 'uploadfile', 'type' => 'file')) ?>
</div>
<?= $this->Form->button('Upload', ['class' => 'btn btn-success btn-pill pull-right']) ?>
<?= $this->Form->end() ?>
关于我在做什么错的任何想法吗?