-1

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.

michael
  • 1,150
  • 7
  • 19

2 Answers2

1

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

robertp
  • 3,019
  • 1
  • 15
  • 13
0

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.

J_A_X
  • 12,824
  • 1
  • 23
  • 31
  • J_A_X, thanks for your reply. They are not in the same security sandbox. They have crossdomain.xml, but it seems it do not solve the problems. Actually, I am try to upload the image to the Picasa Web and I face with this problem. I know I can set a proxy script in my server to solve it. However, I would like to know is there any method that I don't know can solve it. – michael Mar 21 '11 at 23:48
  • Maybe It's a limitation that I haven't heard before by using crossdomains, but to tell you the truth, I've never had to modify headers in my requests. You should use a middleware solution where you can post your image to a php script (or any server side language) that then sends it off to the Picasa server using the proper header. Should be very easy to implement, plus it makes it easier to update your system in the future. – J_A_X Mar 22 '11 at 17:02