This article describes how to use php to receive binary code and convert it to an image. For more information, see. Php develops a program for generating images by cropping images online in Flash, and sends the binary data of the Flash POST image to php. The php generates images for storage. Receiving data with $ _ POST is not acceptable, and PHP only recognizes the application/x-www.form-urlencoded standard data type by default. Therefore, text/xml, soap, application/octet-stream and other types cannot be parsed. if you use the $ _ POST array to receive them, it will fail! Therefore, the prototype is retained and sent to $ GLOBALS ['http _ RAW_POST_DATA '] for receiving. In addition, php: // input can also implement this function. Php: // input allows reading original POST data. Compared with $ HTTP_RAW_POST_DATA, it puts less pressure on the memory and does not require any special php. ini settings. Php: // input and $ HTTP_RAW_POST_DATA cannot be used for enctype = "multipart/form-data ". Use JPGEncoder in Flash to convert BitMapData to binary, and then post it to php code. 1. php page code
2. applications in thinkphp;
|