Search Webmaster Help and Solution

PHP not accepting uploaded files from HTTP POST

Hi,

I hope someone can help me with this. Ive created a php script to POST files to a php page, which should receive them and save them.

So far, a basic form-urlcoded POST works and displays the sent message, but when I try to include a mime encoded stream with the files using multipart/form-data, neither $_FILES, $_POST nor any of the other variables that are meant to hold the uploaded file details have anything in them.

The mime stream Im sending is:

Code: POST /sitemaint/formdatapost.php HTTP/1.1 Host: allaboutpnp MIME-Version: 1.0 Content-Type: multipart/form-data; boundary="=_3248657b0008c22f2882633a6766d5cd" Content-Length: 6099 --=_3248657b0008c22f2882633a6766d5cd Content-Disposition: form-data Content-Type: text/plain Action=process --=_3248657b0008c22f2882633a6766d5cd Content-Disposition: form-data Content-Type: multipart/mixed; boundary="=_0bfabab46ee6d6eff7e4198f18ba0195" --=_0bfabab46ee6d6eff7e4198f18ba0195 Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="logo-hdr.gif" Content-ID: <6c419e0f9466b7bc682e2ae11017ae13> (image contents here) --=_0bfabab46ee6d6eff7e4198f18ba0195-- --=_3248657b0008c22f2882633a6766d5cd Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="tld.txt" (attached file contents here) --=_3248657b0008c22f2882633a6766d5cd-- "

Can anyone spot or suggest anything that could be wrong, please?

Debbie-Leigh Hi,

I hope someone can help me with this. Ive created a php script to POST files to a php page, which should receive them and save them.

So far, a basic form-urlcoded POST works and displays the sent message, but when I try to include a mime encoded stream with the files using multipart/form-data, neither $_FILES, $_POST nor any of the other variables that are meant to hold the uploaded file details have anything in them.

The mime stream Im sending is:

Code: POST /sitemaint/formdatapost.php HTTP/1.1 Host: allaboutpnp MIME-Version: 1.0 Content-Type: multipart/form-data; boundary="=_3248657b0008c22f2882633a6766d5cd" Content-Length: 6099 --=_3248657b0008c22f2882633a6766d5cd Content-Disposition: form-data Content-Type: text/plain Action=process --=_3248657b0008c22f2882633a6766d5cd Content-Disposition: form-data Content-Type: multipart/mixed; boundary="=_0bfabab46ee6d6eff7e4198f18ba0195" --=_0bfabab46ee6d6eff7e4198f18ba0195 Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="logo-hdr.gif" Content-ID: <6c419e0f9466b7bc682e2ae11017ae13> (image contents here) --=_0bfabab46ee6d6eff7e4198f18ba0195-- --=_3248657b0008c22f2882633a6766d5cd Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="tld.txt" (attached file contents here) --=_3248657b0008c22f2882633a6766d5cd-- "

Can anyone spot or suggest anything that could be wrong, please?

Debbie-Leigh

View Complete Thread with Replies

Related Items

Query failed: connection to localhost:3354 failed (errno=111, msg=Connection refused).