3 Replies Latest reply on Sep 11, 2007 7:16 AM by kglad

    IOErrror using URLLoader with files bigger than a few kb

    P Steven Level 1
      I am having problems using URLLoader to send data to a server side script.

      What I am doing is loading in a file as binary data and converting to Base64 then sending this Base64 string within an xml string.

      It is working fine with very small files of only a few kb. However if the files are larger than this, I get an IOError#2032

      The client insists there is no problem at the server side and I cannot think of anything else to try my end.

      Is there any possibility that with larger files, the Base64.Encode operation has not completed before the data is sent?

      Here is the relevant code:

      var dataStrEncoded:String=Base64.Encode(ByteLoader.data);

      var XMLString:String;

      XMLString = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';
      XMLString = '<file>';
      XMLString += '<![CDATA[' + dataStrEncoded + ']]>';
      XMLString += '</file>';

      var scriptPath:String = uploadUrl + "?xml=" + XMLString + "&key=" + _key + "&session=" + _sessionId;

      _loader = new URLLoader();

      _loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorListener);

      var request:URLRequest = new URLRequest(scriptPath);