Page 1 of 1

Bad Fetch Error when submitting a recorded file...

Posted: Tue Sep 09, 2003 12:23 am
by tloring
I receive an "a serious error of type: error bad fetch occurred. exiting" after a submit to my server. I do receive the file OK on my server.

I am wondering, is there some particular return content required?

I am submitting with the following tag:

<submit next="http://<host>/upload.php" method="post" name
list="final_recording"/>

The upload.php contains just the following:

<?
foreach ($_FILES as $file ) {
move_uploaded_file($file['tmp_name'], "/tmp/$file[name].raw");
}
?>

The return headers are:

HTTP/1.1 200 OK
Date: Tue, 09 Sep 2003 05:21:38 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_python/2.7.8 Python/1.5.2 mod_ssl/2.8.12 OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26 mod_throttle/3.1.2
X-Powered-By: PHP/4.1.2
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html


Are the additional headers here any issue? Is there any particular content which is required or expected?

IVR Bad Fetch Error on Submit of recording file

Posted: Tue Sep 09, 2003 10:31 am
by support
When submitting, the document being submitted to must return a valid voice XML document. Assume the following <submit> statement is used:

Code: Select all

<submit next="http://www.myhost.com/upload.php" method="post" namelist="final_recording"/> 

This would be an invalid page for upload.php:

Code: Select all

<?php 
foreach ($_FILES as $file ) { 
move_uploaded_file($file['tmp_name'], "/tmp/$file[name].raw"); 
} 
?> 
The preceding IVR example is invalid because it is not a valid voice XML document, so the IVR doesnt know what to do with it, and throws an error.badfetch

Here is a valid implementation of upload.php:

Code: Select all

<?php 

echo "<?xml=\"1.0\"?>";

foreach ($_FILES as $file ) { 
move_uploaded_file($file['tmp_name'], "/tmp/$file[name].raw"); 
} 
?>
<vxml version="2.0">
 <form id="myform">
 </form>
</vxml>

Posted: Tue Sep 09, 2003 1:13 pm
by tloring
Ok, that did the trick, thank you.