我有这个代码,我需要在文件夹 images/app 中复制两个图像“原始”和“tmp_image”。
我怎样才能移动这些图片?:
我试过这个,但只移动图片“原始”:
move_uploaded_file("images/app/".$_FILES["imagen"]["tmp_name"],"images/app/".$_FILES["imagen"]["name"]);
function resize($target,$new,$w,$h,$type){
list($wo,$ho)=getimagesize($target);
if($type=="image/jpeg"){
$nen = imagecreatefromjpeg($target);
}elseif($type=="image/gif"){
$nen = imagecreatefromgif($target);
}elseif($type=="image/png"){
$nen = imagecreatefrompng($target);
}
$chen = imagecreatetruecolor($w,$h);
imagecopyresampled($chen,$nen,0,0,0,0,$w,$h,$wo,$ho);
imagejpeg($chen,$new,80);
}
和
move_uploaded_file($_FILES["imagen"]["tmp_name"],$_FILES["imagen"]["name"]);
$meter = "http://server/prueba/images/app/" . $_FILES["imagen"]["name"];
$target = $_FILES["imagen"]["name"];
$ssql = "insert into ofertas (imagen) values ('" . $meter . "')";
$new = "resize_".$target;
$type = $_FILES['imagen']['type'];
$w = 80;
$h = 80;
resize($target,$new,$w,$h,$type);
谢谢大家!!