我想使用此示例http://www.sajithmr.me/jrecorder/example2.html录制音频并将其发送到我的本地主机服务器,但我有问题在这里。我的代码在下面说明无法上传服务器上的文件
<script>
$.jRecorder(
{
host : 'http://localhost/Jrec/html/acceptfile.php?filename=hello.wav',
callback_started_recording: function(){callback_started(); },
callback_stopped_recording: function(){callback_stopped(); },
callback_activityLevel: function(level){callback_activityLevel(level); },
callback_activityTime: function(time){callback_activityTime(time); },
callback_finished_sending: function(time){ callback_finished_sending() },
swf_path : 'jRecorder.swf',
}
);
</script>
这个我acceptfile.php
if(!isset($_REQUEST['filename']))
{
exit('No file');
}
$upload_path = dirname(__FILE__). '/';
$filename = $_REQUEST['filename'];
$fp = fopen($upload_path."/".$filename.".wav", "wb");
fwrite($fp, file_get_contents('php://input'));
fclose($fp);
exit('done');
whalt应该我$ upload_path =目录名(FILE)做的。 “/ ;?
当我按下发送数据按钮时,文件不会上传到以下目录(“文件”)。有什么问题就在这里,任何帮助将apriciated
你为什么使用绝对路径?它不在同一个域上吗?另外,你能给我们一些日志吗? – Shikiryu
仅供参考,在“swf_path:'jRecorder.swf',' –