0

I'm looking for help in something that I can't figure out....

I'm receiving in a PHP some data sent by a .swf...

var requestHeader:* = new URLRequestHeader("Content-type", "application/octet-stream");  
var request:* = new URLRequest(url);  
new URLRequest(url).requestHeaders.push(requestHeader);  
request.method = URLRequestMethod.POST;  
request.data = this.getByteArray(o, a, l, a2, l2);
navigateToURL(request, "_blank");`

I can't modify that code... that's a swf... but it works...

now... the php i'm using receives this as its header

Host: localhost  
Connection: keep-alive  
Referer: http://localhost/archivo.swf  
Content-Length: 135782  
Cache-Control: max-age=0  
Origin: null  
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16  
Content-Type: application/octet-stream  
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5  
Accept-Encoding: gzip,deflate,sdch  
Accept-Language: es-ES,es;q=0.8,en-US;q=0.6  
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 

looking at the content-length. I can see that some data was received. but debugging or printing the PHP. the POST has 0 items. the GET has the session id. and the REQUEST also has the session id

appending to the header

header("Content-disposition: attachment; filename=archivo.png"); 

only downloads the content of the printed php (in this case the headers, a 1.something kB file)

is there anyway to retrieve the content that has a size of 135782?

Thanks!

weltraumpirat
  • 22,544
  • 5
  • 40
  • 54
figus
  • 307
  • 2
  • 15
  • 1
    possible duplicate of [How to access POST data in PHP?](http://stackoverflow.com/questions/664148/how-to-access-post-data-in-php) – mario Mar 15 '11 at 17:16
  • @mario awesome... I didn't really know what I was looking for..., I knew it was receiving a file, but didn't know where to look for it, `php://input` was the place to look for, thanks!... can't mark a comment as an answer... bu :(, maybe if you post it as an answer?? or tell me how to mark a comment?? is it possible?? – figus Mar 16 '11 at 01:39

1 Answers1

0

One issue I see is that you should be using a URLLoader to POST data from the SWF, rather than the navigateToURL function.

var urlLoader:URLLoader = new URLLoader();
urlLoader.load(request);

For the Adobe docs:

Note: When using the navigateToURL() function, the runtime treats a URLRequest object that uses the POST method (one that has its method property set to URLRequestMethod.POST) as using the GET method.

Justin Putney
  • 752
  • 1
  • 5
  • 16