我有一个用户个人资料页面,用户可以从文件对话框上传他的个人资料图片。
当文件移动到我的本地服务器文件夹时,它只得到了 0644 的权限。
但是我想在上传到服务器之前将此图片调整大小...
为此,我需要获得 0777 权限来编辑它...
我该怎么做?
这是我移动和调整大小的代码:
$upload_dir = './images';
$tmp = $_FILES["img"]["tmp_name"];
$names = $_FILES["img"]["name"];
$res=$moveR=move_uploaded_file($tmp, "$upload_dir/$names");
$a="./images/".$names;
list($width, $height) = getimagesize($a);
$newwidth = "300";
$newheight = "200";
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($a);
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
imagejpeg($thumb, $a, 100);
Thanks in advance..