Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用AS3和PHP从flash保存文本和音频_Php_Actionscript 3_Audio_Text - Fatal编程技术网

使用AS3和PHP从flash保存文本和音频

使用AS3和PHP从flash保存文本和音频,php,actionscript-3,audio,text,Php,Actionscript 3,Audio,Text,我需要从用户保存音频文件,并给它一个唯一的名称。音频代码正在工作,但我尚未成功发送文件名。有什么建议吗 闪存代码: function onSave():void { soundO.position=0; testAudio=enco.encode(soundO,1); file.save(testAudio,Subject+".wav"); var req:URLRequest = new URLRequest('upload.php'); var loader:URLLoader = new

我需要从用户保存音频文件,并给它一个唯一的名称。音频代码正在工作,但我尚未成功发送文件名。有什么建议吗

闪存代码:

function onSave():void
{
soundO.position=0;
testAudio=enco.encode(soundO,1);
file.save(testAudio,Subject+".wav");

var req:URLRequest = new URLRequest('upload.php');
var loader:URLLoader = new URLLoader();
req.contentType = 'application/octet-stream';
req.method = URLRequestMethod.POST;
req.data = testAudio;
loader.load(req);
}
PHP代码

<?php
$fp = fopen( 'filename.wav', 'wb' );
fwrite($fp, file_get_contents('php://input'));
fclose( $fp );
?>


谢谢

检查我的答案作为替代,文件名可以作为查询字符串参数传递。