Hi Guys,

I've seen this question posted previously with no answer given.  In
the AS3 docs, it outlines that you can submit ByteArray data to a
server-side script by setting the URLRequest.data property to the
array.  The problem is the docs don't seem to indicate how that data
is sent server-side - i.e. what's the key/value pair used?

My server-side code gets triggered, but the data sent doesn't look
like a regular multipart form data that you would receive from a File
upload.  I can't parse the data.

Here's what I'm doing (the dataToPost ByteArray will contain Bitmap data):

public function postData(dataToPost:ByteArray):void
{
  // Create a loader and init it's events
  var loader:URLLoader = new URLLoader();
  configureListeners(loader);
                        
  // Create a Request object
  var url:String = "http://localhost/test/upload.aspx";;
  var request:URLRequest = new URLRequest(url);
  request.contentType = "multipart/form-data";
  request.method = URLRequestMethod.POST;  
                        
  // Set the data                       
  request.data = dataToPost;

  try 
  {
    // Execute the send 
    loader.load(request);
  } 
  catch (error:Error) 
  {
    trace("Unable to load requested document.");
  }
}

Thanks for any insight!

B.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to