我来自下面 voicexml 的帖子作为我的 php 脚本到达
$ _POST['SOURCEADDR'] & $ _POST['recMsg']
我必须在我的服务器配置上做些什么来启用$_FILES[]
吗?当我从 html 网页发布时,我的相同脚本可以正常工作。
<form id="record">
<record name="recMsg" beep="true" maxtime="120s" finalsilence="5000ms" dtmfterm="true" type="audio/basic">
<prompt>
<audio src="sounds/RECORD_AFTER_BEEP.au"/><audio src="sounds/COMEDY_WARRANT.au"/>
</prompt>
<noinput>
<audio src="sounds/NOTHING_RECORDED.au"/>
</noinput>
<filled>
<submit next="saveRecording.php" namelist="SOURCEADDR recMsg" method="post" enctype="multipart/form-data"/>
</filled>
</record>
</form>
====== PHP Script =====
<?
if ($_FILES){
$ftype = $_FILES["recMsg"]["type"];
$fsize = $_FILES["recMsg"]["size"];
$ftemp = $_FILES["recMsg"]["tmp_name"];
$phone = $_REQUEST["SOURCEADDR"];
$fname = "rec_".$phone."_".date("Ymdgis").".au"; //$_FILES['recMsg']['name'];
flog("debug.log", "Got: $ftype | $fsize | $phone | $fname");
}else{
$out = flog("debug.log", "no $ _FILES array");
echo '<?xml version="1.0" encoding="ISO-8859-1"?><vxml version="2.0"><form id="main">
<block>'.'ERROR POST'.'</block></form></vxml>';
exit;
}
?>