phpput请求数据流 php put请求( 二 )


foreach($_FILES as $file)
{
$tempFileName = $file['tmp_name'];//上传文件的临时路径
}
/把图片移动到服务器制定路径
$img = '/var/www/html/picture/test.jpg';
move_uploaded_file($tempFileName, $img);
//缩放比例
$ratio = 0.5;
//修改尺寸 至于各个函数是干嘛的phpput请求数据流,google一下吧
$imagedata = https://www.04ip.com/post/getimagesize($img);
$olgWidth = $imagedata[0];
$oldHeight = $imagedata[1];
$newWidth = $olgWidth * $ratio;
$newHeight = $oldHeight * $ratio;
$image = imagecreatefromjpeg($img);
$thumb = imagecreatetruecolor ($newWidth, $newHeight);
imagecopyresized ($thumb, $image, 0, 0, 0, 0, $newWidth, $newHeight, $olgWidth, $oldHeight);
imagejpeg($thumb, $img);
imagedestroy($thumb);
imagedestroy($image);
php对put请求的body是如何处理的可以使用file_get_contents("php://input")接收原始数据,然后自己原始数据
【phpput请求数据流 php put请求】关于phpput请求数据流和php put请求的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

推荐阅读