敏捷上传器(在上传到服务器之前调整图像大小):如果图像名称包含西里尔字母,则不起作用

发布于 2025-01-01 02:40:58 字数 266 浏览 2 评论 0原文

我在项目中使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

想挽留 2025-01-08 02:40:58

嗯...从技术上讲,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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文