Has anyone experienced problems uploading large files with URLLoader?

 

I am reading in a file as binary data and converting it to Base64 using the
built in Base64 class. I am then popping this base64 data into an xml file
and uploading using URLLoader.

 

It all works fine with files up to about 10mb but files larger than this
appear to be crashing my app. Not sure what URLLoader does exactly but there
appears to be a delay of about 6 minutes before I see any network traffic so
I assume that it is processing the data before it sends it? 

 

I would really appreciate any advice on this problem as I would prefer not
to have to recode this using a different approach. I have heard there is
another way to send data using HTTP Service - does anyone know if this is a
better way to go about this?

 

Thanks

 

Here is some of my code

 

var be:Base64Encoder = new Base64Encoder();

be.encodeBytes(ByteLoader.data);        

                                                

var dataStrEncoded:String = be.flush();

                                                                

var XMLString:String;                                      

                                                

XMLString = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';

XMLString = '<file>';

XMLString += '<![CDATA[' + dataStrEncoded + ']]>';


XMLString += '</file>';

 

var dataToSend:XML = new XML(XMLString); 

 

_loader = new URLLoader();       

_loader.addEventListener(Event.COMPLETE,fileUploadCompleteListener);


                                                

_loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorListener);


 


var request:URLRequest = new URLRequest(scriptPath);

request.method = URLRequestMethod.POST;

                                                

var variables:URLVariables = new URLVariables();


variables.xml = XMLString;                           

                                                

request.data = variables;


                                                

_loader.load(request);

Reply via email to