敏捷上传器(在上传到服务器之前调整图像大小):如果图像名称包含西里尔字母,则不起作用
我在项目中使用 Agile Uploader 在上传之前调整图像大小在客户端。 它工作正常,除了一件事:如果图像名称包含西里尔字母,它会失败并出现服务器错误 500。
如何避免这种情况,或者如果需要,如何“动态”用英文字母重命名文件(可能使用 JavaScript)。
提前致谢!
I'm using Agile Uploader in my project to resize image before upload on client side.
And it works fine except one thing: if image name contains cyrillic letters it fails with server error 500.
How to avoid this or if needed how to rename file with english letters "on fly" (possibly with javascript).
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯...从技术上讲,Agile Uploader 并没有按照它所说的那样做(而且说实话,这不是一个非常高质量的代码...)。它使用 MultipartURLLoader 来执行此操作,其中,反过来,代码稍微好一点,但是......好吧,我并不是说你必须重做所有这些,而是你想要修复的东西,可能是该文件的一部分,内部类 FilePart,它在其中写入它应该执行的文件名
escapeMultibyte
名称,因为代码将其写为 UTF-8,但将标头声明为单字节。Well... Agile Uploader, technically, doesn't do what it says (and it's not a very quality code to be honest...). It uses MultipartURLLoader to do it, which, in it's turn is slightly better code, but... OK, I'm not saying you have to redo all that, but something you would like to fix, probably is the part of that file, the internal class FilePart, where it writes the file name it should do
escapeMultibyte
the name, because the code writes it as UTF-8, but declares the headers as single-byte.