Home > flex > Multipart form data in flash

Multipart form data in flash

Eugene has a handy MultipartURLLoader class to do the leg work of sending multipart form data from flash.

Note that because it uses:
urlRequest.requestHeaders.push( new URLRequestHeader( ‘Cache-Control’, ‘no-cache’ ) );

You may get SecurityError:
Error #2044: Unhandled securityError:. text=Error #2170: Security sandbox violation: http://domain1.com/your.swf cannot send HTTP headers to http://domain2.com/yourscript.php.

You may need to add a variation of <allow-http-request-headers-from domain=”*” headers=”*”/>  to your crossdomain.xml file or comment out that line. I chose the latter as I don’t think its neccessary in a POST call.

Categories: flex Tags:
  1. Marc
    February 24th, 2011 at 12:34 | #1
  2. Ça?atay
    June 23rd, 2011 at 00:54 | #2

    I did use the same uploader class as Marc, and your solution has worked. Many thanks… :)

  3. November 1st, 2011 at 01:05 | #3

    I’m so excited that you guys will be coming to Penn State! You are all amazing on stage and I can’t wait to see you live again! I’m 30 mins away from there, so I can recommend some great dive bars with yummy food.

  4. November 4th, 2011 at 16:47 | #4

    wonderful publish, very informative. I wonder why the other specialists of this sector don’t understand this. You should continue your writing. I am confident, you’ve a great readers’ base already!

  1. March 11th, 2009 at 03:29 | #1