从闪存发送大量数据时出现问题

发布于 2024-12-04 13:40:51 字数 685 浏览 1 评论 0原文

我在从闪存发送巨大(~4MB)数据块到我的 java servlet 时遇到问题,目前我正在使用 URLVariables 传输数据,但是这似乎有一个限制(因为它似乎可以工作,与较小的数据块),我如何抑制此限制,或以任何其他方式将我的数据获取到我的 servlet。

到目前为止我的闪存代码:

var variables:URLVariables = new URLVariables();
variables.name = name_string; //Plenty of these small attributes
variables.data = data_string; //And the huge BLOB

var sendReq:URLRequest = new URLRequest("http://localhost:8080/recieve/");
sendReq.method = URLRequestMethod.POST;
sendReq.data = variables;

var sendLoader:URLLoader;
sendLoader = new URLLoader();
sendLoader.addEventListener(Event.COMPLETE, Handler);
sendLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
sendLoader.load(sendReq);

I'm having an issue sending a huge (~4MB) block of data from flash, to my java servlet, currently I'm transferring the data using URLVariables, however it seems there's a limit to this (because it seems to work, with smaller data blocks), how do I suppress this limit, or in any other way, get my data to my servlet.

My flash code so far:

var variables:URLVariables = new URLVariables();
variables.name = name_string; //Plenty of these small attributes
variables.data = data_string; //And the huge BLOB

var sendReq:URLRequest = new URLRequest("http://localhost:8080/recieve/");
sendReq.method = URLRequestMethod.POST;
sendReq.data = variables;

var sendLoader:URLLoader;
sendLoader = new URLLoader();
sendLoader.addEventListener(Event.COMPLETE, Handler);
sendLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
sendLoader.load(sendReq);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

淤浪 2024-12-11 13:40:51

首先,所有帖子方法在IE中的2000多个字符左右(8点以前的至下)失败。

接下来,urlloader:请参阅 flash/as3-同时urlloader.load()请求的数量有限制吗?

那样发送。这将消除最大问题。

First, All POST methods fail at around 2000+ characters in IE (at-least prior to 8).

Next, there is a limit to the URLLoader: see Flash/AS3 - is there a limit to the number of simultaneous URLLoader.load() requests?

If possible, try breaking your data up into smaller pieces and sending it that way. This will eliminate the maximum problems.

°如果伤别离去 2024-12-11 13:40:51

经过研究后,我之前的建议 FileReference 是一个坏主意,因为 BitmapData 是在内存中创建的。

我建议尝试 如何将 ByteArray(来自 Flash)和一些表单数据发送到 php?

After looking into it, my earlier suggestion, FileReference, is a bad idea given the BitmapData is created within memory.

I will suggest trying How can I send a ByteArray (from Flash) and some form data to php?

红ご颜醉 2024-12-11 13:40:51

因此,在尝试了闪光灯之后,我想出了一个解决方案;

我只是将 data_string 分解为给定大小的子字符串,然后枚举这些子字符串,并使用 URLLoader 和 part_id 传输每个子字符串。

然后,子字符串的收集由服务器端的part_ids 完成。

So after playing around with flash, I came up with a solution;

I simply broke the data_string into sub-strings of a given size, then enumerating these, and transferring each of these using the URLLoader, along with a part_id.

The collection of the sub-strings is then done at server-side, by the part_ids.

淡莣 2024-12-11 13:40:51

这听起来更像是服务器端的问题。检查您的 java 环境设置并增加允许的最大 POST/请求大小。

将数据分成多个部分并分别发送的解决方案可能只能起作用,因为每个部分都小于服务器端的限制。

This sounds more like an issue on the server side. Check your java environment settings and increase the maximum allowed POST/Request size.

The solution of breaking the data into multiple parts and sending them separately probably only works because each part is smaller than the server-side limit.

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