Question

I will use the URLRequest to upload the modified image in Flex. It works fine. However, I need to add Content-Length as a URLRequestHeader for the moment, and I get error 2096. Then, I know that this header is not allowed.

How can I solve this case.

Please advice, thanks.

Update: According to adobe's documentation: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLRequestHeader.html

In Flash Player and in Adobe AIR content outside of the application security sandbox, the following request headers cannot be used, and the restricted terms are not case-sensitive (for example, Get, get, and GET are all not allowed). Also, hyphenated terms apply if an underscore character is used (for example, both Content-Length and Content_Length are not allowed):

Accept-Charset, Accept-Encoding, Accept-Ranges, Age, Allow, Allowed, Authorization, Charge-To, Connect, Connection, Content-Length, Content-Location, Content-Range, Cookie, Date, Delete, ETag, Expect, Get, Head, Host, If-Modified-Since, Keep-Alive, Last-Modified, Location, Max-Forwards, Options, Origin, Post, Proxy-Authenticate, Proxy-Authorization, Proxy-Connection, Public, Put, Range, Referer, Request-Range, Retry-After, Server, TE, Trace, Trailer, Transfer-Encoding, Upgrade, URI, User-Agent, Vary, Via, Warning, WWW-Authenticate, x-flash-version.

Was it helpful?

Solution

This is a security sandbox issue. Is the url you're trying to post to in the same security sandbox? If not, do they have a crossdomain.xml on there. If not, you might want to look in a server solution like send the image to your server on the same domain, which in return sends the image with the proper headers to the service you're trying to connect to.

OTHER TIPS

I found this: http://blogs.adobe.com/koestler/2010/12/dealing-with-argumenterrors-while-pushing-urlrequestheaders.html

Maybe your problem is caused by the newline as well.

Good luck, Rob

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top