hi all,
I did face the similar issue and i cant set request headers in flash AS3. Actually i m trying to download file from S3 Amazon Bucket, which can only be allowed if custom header is set in a request. I m trying to set that but when I check the request Packets from Etheral or WireShark, the request doesnt contain any of mine custom header.
here is my flash download code;
var headers:Array = new Array();
var authHeader:URLR equestHeader = new URLRequestHeade r("Authorizatio n","AWS: "+accesskey+":" +signature);
var dateHeader:URLR equestHeader = new URLRequestHeade r("x-amz-date",date);
request.url = domainUrl+objec tkey;
request.method = URLRequestMetho d.GET;
headers.push(au thHeader);
headers.push(da teHeader);
request.request Headers = headers;
trace('request: '+request.reque stHeaders.lengt h);
try {
loader.load(req uest);
}catch (error:Error) {
trace("Unable to load requested document.");
}
Remember I uploaded crossdomain.xml in the bucket with polies mentioned as under;
<cross-domain-policy>
<allow-access-from domain="*" secure="false" />
<site-control permitted-cross-domain-policies="all"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
In order to download file from Amazon Bukcet the Request Packet should be;
GET /<bucketname>/<filename>HTT P/1.1
x-flash-version: 10,0,2,54
User-Agent: Shockwave Flash
Host: s3.amazonaws.co m
Authorization: AWS:<accesskey> :<signature>
x-amz-date: <date>
but after doing all the above work my final request sent to amazon;
GET /<bucketname>/<filename>HTT P/1.1
x-flash-version: 10,0,2,54
User-Agent: Shockwave Flash
Host: s3.amazonaws.co m
:( no custom header here;
plz can anyone suggests