FilePond:所有 JPEG 文件均以“.jpg”形式上传- 为什么?
我写了一个小的filepond示例(出色的工作btw),但是有一件事我无法理解:
当我上传时,例如,“ foo.jpg”或“ foo.jpeg”,它被保存为“ foo .jpg“在服务器上。
我想保留文件扩展名,但不知道该怎么做。
我已经尝试了filerename-plugin,但这些文件仍然保存为.jpg。
I've written a small FilePond example (excellent piece of work BTW) but there is one thing that I can't understand:
When I upload, e.g., "foo.JPG" or "foo.jpeg" it is saved as "foo.jpg" on the server.
I would like to keep the file extension, but don't know how to do it.
I've tried the FileRename-plugin but the files are still saved as .jpg.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想出了一个解决方案。如果有人感兴趣,我可以发布完整的代码,但基本上我将真实的文件名(例如“foo.jpeg”)存储在元数据中,并在 PHP 服务器端提取它,然后使用该名称重命名临时文件。
在 FilePond.create 中:
I worked out a solution. If anyone is interested I can post complete code, but basically I stored the real filename (e.g., "foo.jpeg") in metadata and extracted it on the PHP server side, and then renamed the temporary file using that name instead.
In FilePond.create: