blinker82
asked on
HTTP Error 411, Method Post, PHP
I am doing a post to a PHP script.
I am sending a file .It was working fine on a particular server.
Now I shifted the script to another server.............Now I get an http 411 error........it needs the content length.
How can I send the content length?
I am sending a file .It was working fine on a particular server.
Now I shifted the script to another server.............Now I get an http 411 error........it needs the content length.
How can I send the content length?
ASKER
Ya, I am sending a sound file .....actually I am sending it from a vxml script and not from an html form or php form.
So i am not sure if I can use header('Cont..........
Or Can I?
So i am not sure if I can use header('Cont..........
Or Can I?
hope following link may give some idea about the error.
http://www.checkupdown.com/status/E411.html
thanks.
http://www.checkupdown.com/status/E411.html
thanks.
What web server are you using?
Sorry, just now read your previous post in the other area. You probably need to register the MIME type of your audio file with IIS. Go to your web page properties, click on HTTP Headers -> File Types. Enter the mime types for your file there. There's a pretty good list of mime types here: http://www.webmaster-toolkit.com/mime-types.shtml
Hope that helps,
-Doug
Hope that helps,
-Doug
And I'm just guessing, but since vxml is always for audio, then you might want to register the .vxml extension to the (mime) type of audio it produces.
Well, nevermind. From what I can find, you shouldn't need to register a mime type with IIS at all for vxml apps. Your problem is probably with your network or web server setup. Try checking the link that designbai gave.
-Doug
-Doug
ASKER
umm.......let us bring the discussion from my other question here.
Let me put it again over here
hi
I am working on cisco voice gateway and all i need to is post an audio file which I save on the local RAM at the gateway to my server (IIS 5.0)
the code for submit is
<submit next="http://IPaddrXXX:portXXX/xml/loadsound.php" namelist ="myrec" method="post" enctype="multipart/form-da ta"/>
the audio file is being saved as myrec.
My loadsound.php goes as follows:-
<?php
$msg = "";
$code = 1;
/*
$tmpFile=$HTTP_POST_FILES[ 'myrec'][' tmp_name'] ;
if (is_uploaded_file($tmpFile ))
{
$wavfile="wav/".date("YmdH is").".wav ";
copy($tmpFile, sprintf("%s",$wavfile));
$msg = "audio saved";
}
else
{
$code = 0;
$msg = "unable to save audio";
}
*/
$to = "XXXX@yahoo.com";
$from = "janedoe@anotherfakedomain .com";
$subject = "This is a test email";
$message = "Dear John,\n\nThis is a fake email, I hope you enjoy it.\n\nFrom Jane.";
$headers = "From: $from\r\n";
$success = mail($to, $subject, $message, $headers);
if ($success)
echo "The email to $to from $from was successfully sent";
else
echo "An error occurred when sending the email to $to from $from" ;
?>
But What is happening is that even the php script is not being invoked since I do not recieve an email as it should
But if i use
<goto next="http://IPaddrXXX:portXXX/xml/loadsound.php">
It calls the script and sends me a mail.
So the paths and IP addresses,portno. all are fine.
Some problem with POST. Am I doing something wrong while posting it? At times I even get a http 503 .
Let me put it again over here
hi
I am working on cisco voice gateway and all i need to is post an audio file which I save on the local RAM at the gateway to my server (IIS 5.0)
the code for submit is
<submit next="http://IPaddrXXX:portXXX/xml/loadsound.php" namelist ="myrec" method="post" enctype="multipart/form-da
the audio file is being saved as myrec.
My loadsound.php goes as follows:-
<?php
$msg = "";
$code = 1;
/*
$tmpFile=$HTTP_POST_FILES[
if (is_uploaded_file($tmpFile
{
$wavfile="wav/".date("YmdH
copy($tmpFile, sprintf("%s",$wavfile));
$msg = "audio saved";
}
else
{
$code = 0;
$msg = "unable to save audio";
}
*/
$to = "XXXX@yahoo.com";
$from = "janedoe@anotherfakedomain
$subject = "This is a test email";
$message = "Dear John,\n\nThis is a fake email, I hope you enjoy it.\n\nFrom Jane.";
$headers = "From: $from\r\n";
$success = mail($to, $subject, $message, $headers);
if ($success)
echo "The email to $to from $from was successfully sent";
else
echo "An error occurred when sending the email to $to from $from" ;
?>
But What is happening is that even the php script is not being invoked since I do not recieve an email as it should
But if i use
<goto next="http://IPaddrXXX:portXXX/xml/loadsound.php">
It calls the script and sends me a mail.
So the paths and IP addresses,portno. all are fine.
Some problem with POST. Am I doing something wrong while posting it? At times I even get a http 503 .
ASKER
I am sorry it was not http 503 .........but the Bad Gateway Error i.e http 502.
The vxml script
<submit next="http://IPaddrXXX:portXXX/xml/loadsound.php" namelist ="myrec" method="post" enctype="multipart/form-da ta"/>
is taken as it is from the manual. But even if the Post fails, should it atleast execute the php script and send the mail.
It is not even doing that .........and I am stuck on this thing for a long time.
Could you guys atleast give me possibilities what exactly could be wrong?
The IIS 5.0 server is inhouse and the other server where I was getting the 411 error, is a diff server I use ..a web hosting service. I was just trying to use a non- IIS server to see if it is an IIS specific problem?
COuld you guys point me ,what steps should I take.........coz I am stuck on this stupid problem for a long long time?
The vxml script
<submit next="http://IPaddrXXX:portXXX/xml/loadsound.php" namelist ="myrec" method="post" enctype="multipart/form-da
is taken as it is from the manual. But even if the Post fails, should it atleast execute the php script and send the mail.
It is not even doing that .........and I am stuck on this thing for a long time.
Could you guys atleast give me possibilities what exactly could be wrong?
The IIS 5.0 server is inhouse and the other server where I was getting the 411 error, is a diff server I use ..a web hosting service. I was just trying to use a non- IIS server to see if it is an IIS specific problem?
COuld you guys point me ,what steps should I take.........coz I am stuck on this stupid problem for a long long time?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
header('Content-Length: ' . $length);
Where $length is the size of your content, in bytes. Really, this is only useful if you're serving files other than text/html. Like I said, you web server should handle sending the content length for you, so your web server is probably the culprit. What's your configuration?
-Doug