在FilePond提取后设置隐藏的输入字段值



我正在使用FilePond的获取路由上传文件。从web拖放图像后,文件URL将成功发送到服务器。我可以按照文档中提到的方式处理并返回响应标头。

return Response::make('', 200, [
'Access-Control-Expose-Headers' => 'Content-Disposition, Content-Length, X-Content-Transfer-Id',
'Content-Type' => mime_content_type($path),
'Content-Length' => filesize($path),
'Content-Disposition' => 'inline; filename="' . $uniqueId . '"',
'X-Content-Transfer-Id' => $uniqueId
]);

上传成功后,filepond生成以图像URL为值的隐藏输入字段。

<fieldset class="filepond--data">
<input type="hidden" name="avatar" value="https://www.somesite.xyz/logo.png">
</fieldset>

我的问题是,它不应该用响应标头X-Content-Transfer-Id的唯一值更新隐藏字段值吗?如果没有,我是否可以通过任何方式将隐藏的输入值设置为标头中的内容,以便在提交实际表单时,我可以获得与服务器中的临时文件相关的一些信息。

这个问题现在随着filepond版本4.27.2的发布而得到修复。以下是详细讨论-问题#714

最新更新