我想用我自己的文本創建一個水印,例如。我想在每個圖像上創建「ABDULLAH」的水印。我在我的uploadify.php文件中有這些代碼行。如何在Uploadify上傳時在每張圖片上創建水印?
<?php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
$ext = end(explode(".", $_FILES['Filedata']['name']));
$FileName = current(explode('.', $_FILES['Filedata']['name']));
$originalFileName = $FileName.".".$ext;
$strRandNum = rand(0,99)+strtotime(date('YmdHis'));
$randomeFileName = $FileName."_".$strRandNum."_uid_".$_REQUEST['user_id'];
$completeFileName = $randomeFileName.".".$ext;
$dir_path = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] .'/'. $dirctory_name. "/";
if((isset ($dirctory_name)) && ($dirctory_name != "") && (is_dir ($dir_path))) {
move_uploaded_file($tempFile,$dir_path.$completeFileName);
}
else {
mkdir($dir_path , 0777);
move_uploaded_file($tempFile,$dir_path.$completeFileName);
}
str_replace($_SERVER['DOCUMENT_ROOT'],'',$targetFile);
}
?>
我使用uploadify插件上傳多個文件.. – Abdullah 2012-02-06 05:25:03