Re: MMS Gateway + PHP
| From: | Jochem Maas | Date: | Mon, 29 May 2006 11:14:42 +0000 |
| Subject: | Re: MMS Gateway + PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237022@lists.php.net to get a copy of this message | ||
kartikay malhotra wrote:
Hi All, I've a typical problem. I'm using Mbuni MMS gateway. This gateaway provides a method of forwarding an incoming MMS file to a HTTP Server, where it could be uploaded. I run a PHP script on the server, to dump the MMS into a database. Now I do not have a typical HTML form to upload the MMS. Only 2 fields in the configuration file : post-url = http://localhost/one.php/ http-post-parameters = userfile=%z where %z signifies all parts of the MM. I'm used to seeing PHP code for uploading files which resembles: if($_FILES['userfile']['size'] > 0 ) { $fileName = $_FILES['userfile']['name']; } Unfortunately, the condition $_FILES['userfile']['size'] is never satisfied. Can anyone help me determine that my file is properly reaching the HTTP server in the first place? If the problem statement isn't clear, all fault is mine :)its not clear to me - but I'll take a guess and say that the relevant content encoding headers were not set therefore php doesn't not recognise the incoming post as a file upload. // generating the relevant header via php header('Content-Type: multipart/form-data') // or specifying the enctype in a form tag declaraction: <form action="" method="post" enctype="multipart/form-data"> it maybe that the header is not named 'Content-Type' - I was just guessing.
Thanx KM