Blog. csdn. netgold2008articledetails8496489 uses php as a forwarding program. It forwards all the data received from the browser to another url for processing. GET and POST operations are normal, but when uploading images, it is found that the upload fails. Check the information and find out. Php: input, $ HTTP_RAW _
Http://blog.csdn.net/gold2008/article/details/8496489 with php to do a forwarding program, is from the browser to receive what data, the complete forwarding to another url for processing, GET, POST are normal, but when uploading images, it is found that the upload fails. Check the information and find out. Php: // input, $ HTTP_RAW _
Http://blog.csdn.net/gold2008/article/details/8496489
Using php as a forwarding program, the system forwards all the data received from the browser to another url for processing. GET and POST operations are normal, but when uploading images, it is found that the upload fails. Check the information and find out.
Php: // input, $ HTTP_RAW_POST_DATA cannot be used for enctype = "multipart/form-data". Because php will try to parse the received data and put it into $ _ POST after parsing, $ _ GET array, which cannot be parsed, is placed in php: // input.
In apache, the Content-Type is manually changed from multipart/form-data to another name, so that php will not parse POST data. The http://stackoverflow.com/questions/1361673/get-raw-post-data man shared his approach.
In apache, add the following to the. htaccess file:
SetEnvIf Content-Type ^ (multipart/form-data) (. *) MULTIPART_CTYPE = $1 $2
RequestHeader set Content-Type application/x-httpd-php env = MULTIPART_CTYPE
Then, in the php program, you can use file_get_contents ('php: // input'); to obtain the original data. Then, the data can be sent out.