1
當文件上傳時,我得到文件名的返回,但是我想將所有文件名存儲在數組中,並將它們附加到php表單中。這是我迄今爲止。將dropzone上傳的文件保存到數組
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')) !!}