在Flash中保存文件而不带提示窗口



我正在Flash中制作卡拉OK应用程序,但我遇到了问题。 当客户端停止唱歌时,我希望此录音保存在服务器上的特定文件夹中,而不显示提示消息。 到目前为止,我使用的所有上传或下载应用程序都FileReference,但它总是有提示消息。 有没有办法直接保存歌曲? 提前谢谢。

我假设您打算将已记录的.wav文件保存到服务器。

// AS3 code
var request:URLRequest = new URLRequest ( 'http://pathto/save.php' );
var loader: URLLoader = new URLLoader();
request.contentType = 'application/octet-stream';
request.method = URLRequestMethod.POST;
// bytes is your byteArray containing an encoded .wav file ready to save.
request.data = bytes;
loader.load( request );

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

http://www.red5-recorder.com/看起来是一个很好的起点

最新更新