Search code examples
flashactionscript-3urlloader

Issue sending a huge amount of data from flash


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);

Solution

  • 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.