0

I have developing a flash and php application..

i want upload audio from flash to php.. [ bytearray data ]

var ogg_data_bytes:ByteArray = _oggManager.encodedBytes;
var request:URLRequest = new URLRequest ('http://ravialla.com/uploads/save.php?filename=myFileName');
var loader: URLLoader = new URLLoader();
request.contentType = 'application/octet-stream';
request.method = URLRequestMethod.POST;
request.data = ogg_data_bytes;
loader.addEventListener(ProgressEvent.PROGRESS, uploadProgress);
loader.addEventListener(Event.COMPLETE, fileUploadSuccess);
loader.addEventListener(IOErrorEvent.IO_ERROR, fileUploadFaild);
loader.load(request);

now I'm passing File name through $_GET.. but I want pass File name through $_POST

any idea ???

thanks:)

Ravi Allam
  • 20
  • 5

1 Answers1

0

Can you try this,

 var loader : URLLoader = new URLLoader();  
var request:URLRequest = new URLRequest ('http://ravialla.com/uploads/save.php');

request.method = URLRequestMethod.POST;  
var variables : URLVariables = new URLVariables();  
variables.key1 = myFileName;  
variables.key2 = "value2";  
request.data = variables;  

//  Handlers  
loader.addEventListener(Event.COMPLETE, on_complete);  
loader.load(request);  
private function on_complete(e : Event):void{  
       // whatever 
 }

Ref: http://scriptcult.com/archives_9/article_442-post-request-data-in-as3.htm

Krish R
  • 22,583
  • 7
  • 50
  • 59
  • http://stackoverflow.com/questions/11341945/how-to-record-audio-and-save-it-in-mp3-format-in-as3-adobe-air2-5 – Krish R Nov 23 '13 at 07:48