本文整理匯總了PHP中URLify::GetLatinSafeFileName方法的典型用法代碼示例。如果您正苦於以下問題:PHP URLify::GetLatinSafeFileName方法的具體用法?PHP URLify::GetLatinSafeFileName怎麽用?PHP URLify::GetLatinSafeFileName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類URLify
的用法示例。
在下文中一共展示了URLify::GetLatinSafeFileName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: UploadTovarImage
function UploadTovarImage($AFileInputName, $APath, $ANewFileName, $AMax_image_x, $AMax_image_y, $AWatermark_position = '', $AWatermark_FileRelativeURL = '', $AFixedSourceFileName = '', $ANewFileExt = '')
{
$vError = "";
$vFileRelativeURL = "";
if (empty($AFixedSourceFileName)) {
$ImgUploader = new Upload($_FILES[$AFileInputName], "ru_RU");
} else {
$ImgUploader = new Upload($AFixedSourceFileName, "ru_RU");
}
if ($ImgUploader->uploaded) {
$ImgUploader->file_overwrite = true;
//$ImgUploader->file_new_name_body = $ANewFileName;
$ImgUploader->file_new_name_body = URLify::GetLatinSafeFileName($ANewFileName);
if (!empty($ANewFileExt)) {
$ImgUploader->file_new_name_ext = $ANewFileExt;
}
if (!empty($AWatermark_position) && $AWatermark_position != '00' && !empty($AWatermark_FileRelativeURL)) {
$ImgUploader->image_watermark_position = $AWatermark_position;
$ImgUploader->image_watermark = DIR_DBIMAGES . 'comission/' . $AWatermark_FileRelativeURL;
}
if ($AMax_image_x != 0 && $AMax_image_y != 0) {
if ($ImgUploader->image_src_x > $AMax_image_x || $ImgUploader->image_src_y > $AMax_image_y) {
$ImgUploader->image_resize = true;
$ImgUploader->image_x = $AMax_image_x;
$ImgUploader->image_y = $AMax_image_y;
$ImgUploader->image_ratio = true;
} else {
$ImgUploader->image_resize = false;
$ImgUploader->image_x = $ImgUploader->image_src_x;
$ImgUploader->image_y = $ImgUploader->image_src_y;
$ImgUploader->image_ratio = false;
}
}
//$ImgUploader->image_convert = gif;
//$ImgUploader->image_ratio_y = true;
$UploadDir = MakeDirForWrite($APath);
$ImgUploader->Process($UploadDir);
if ($ImgUploader->processed) {
$vFileRelativeURL = $APath . $ANewFileName . "." . $ImgUploader->file_dst_name_ext;
$ImgUploader->Clean();
} else {
$vError = $ImgUploader->error;
}
} else {
$vError = $ImgUploader->error;
}
return array($vError, $vFileRelativeURL);
}