How do I get a HTTP_RAW_POST_DATA and can resize to create a smaller image. With the image saved to disk I have classes that does this, more to get HTTP_RAW_POST_DATA I do not know how to do
if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] ))
{
//the image file name
$fileName = $_GET['nome'].".jpg";
// get the binary stream
$im = $GLOBALS["HTTP_RAW_POST_DATA"];
//write it
$fp = fopen('saves/print/'.$fileName, 'wb');
fwrite($fp, $im);
fclose($fp);
}
If the image is coming from a multipart HTML form, then I don't think you can use the raw post data at all...I will likely be empty if I recall my attempts to read it previously.
Instead, you should use move_uploaded_file
Then, resize the image via ImageMagick or GD:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.