【发布时间】:2017-04-08 14:32:46
【问题描述】:
上传文件时我会返回文件名,但我想将所有文件名存储在数组中并将它们附加到 php 表单中。这就是我到目前为止所拥有的。
this.on("success", function(file, res) {
console.log(res.path);
file.newFileName = res;
$path = res.path;
// Create a hidden input to submit to the server:
$("#image").append($('<input type="hidden" ' +'name="files[]" ' +'value="' + res.path + '">'));
});
然后我有,这是 php 形式的。它适用于一个文件名,但只保存最新的一个。
{!! Form::hidden('image', '', array('id' => 'user-image')) !!}
【问题讨论】:
标签: php laravel dropzone.js