当用户使用php上传时,我创建了动态水印图像,图像也在显示,但问题是我不知道如何将图像移动到我的网站中的特定文件夹
$path=JPATH_SITE.'/media/truematrimony/watermark-K'.$id.'_pho_2.jpg';
move_uploaded_file($_FILES["profile_multi2"]["tmp_name"],$path);
$font_path=$_SERVER['DOCUMENT_ROOT'].'/templates/srinivasmatrimony/font/GeosansLight.ttf';
$card = imagecreatefromjpeg($path);
$font_med = 12;
$white = imagecolorallocate($card, 0, 0, 0);
imagettftext($card, $font_lrg, , 40, , $white, $font_path,"kongumarriage.com");
$filenametemp= $_SERVER['DOCUMENT_ROOT'].'/media/truematrimony/watermark- K'.$id.'_pho_2.jpg';
imagejpeg($card, $filenametemp);
$ImageData = file_get_contents($filenametemp);
$ImageDataEnc = base64_encode($ImageData);
unlink($filenametemp);
答案 0 :(得分:0)
使用以下功能
move_uploaded_file ( string $filename , string $destination )
$filename - name of the file to move
$destination = folder where you want to move