问题描述:

i have created dynamic watermark image when user uploads using php, images are also displaying , but the problem is i don't know how to move the images into particular folder in my site

$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);

网友答案:

Use the following function

move_uploaded_file ( string $filename , string $destination )

$filename - name of the file to move
$destination = folder where you want to move
相关阅读:
Top