URLRequestHeader problem in actionscript
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 appl开发者_如何学Pythony 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.
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
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.
精彩评论