本文整理汇总了PHP中FileUpload::DeleteFile方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUpload::DeleteFile方法的具体用法?PHP FileUpload::DeleteFile怎么用?PHP FileUpload::DeleteFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUpload
的用法示例。
在下文中一共展示了FileUpload::DeleteFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ins_foto_old
function ins_foto_old($foto, $tipo, $id_im)
{
$tipot = explode('/', $foto['type']);
if ($tipot[0] != 'image') {
$messaggio = 'Tipo file non valido: devi inserire file in formato .jpg o .gif...' . $foto['type'];
return $messaggio;
} else {
include_once CLASSPATH . 'config_img.php';
include_once CLASSPATH . 'upload.class.php';
if ($tipot[1] == 'jpeg' || $tipot[1] == 'pjpeg') {
$tipoim = '.jpg';
} else {
$tipoim = '.gif';
}
$upt = new FileUpload(TMP_DIR);
$upt->RenameFile($tipo . $id_im . $tipoim);
$upt->Upload($foto);
require_once CLASSPATH . 'image.class.php';
$imgt = new Image(TMP_DIR . '/' . $upt->filename);
ini_set('memory_limit', '30M');
$result = $imgt->CreateSourceImage();
if ($result && strpos($upt->filename, 'foto_g_immobile') === false) {
$imgt->SaveProportionateImageP(THUMB_DIR . '/' . $upt->filename, IMAGE_QUALITY, IMAGE_THBN_HEIGHT, IMAGE_THBN_WIDTH);
$imgt->SaveProportionateImageP(BIG_DIR . '/' . $upt->filename, IMAGE_QUALITY, IMAGE_BIG_HEIGHT, IMAGE_BIG_WIDTH);
$upt->DeleteFile();
return $upt->filename;
} elseif ($result && strpos($upt->filename, 'foto_g_immobile') !== false) {
$imgt->SaveProportionateImageP(THUMB_DIR . '/' . $upt->filename, IMAGE_QUALITY, IMAGE_THBN_HEIGHT, IMAGE_THBN_WIDTH);
$imgt->SaveProportionateImageP(BIG_DIR . '/' . $upt->filename, IMAGE_QUALITY, IMAGE_BIG_HEIGHT, IMAGE_BIG_WIDTH);
$imgt->SaveProportionateImageP(MEDIE_DIR . '/' . $upt->filename, IMAGE_QUALITY, IMAGE_MEDIE_HEIGHT, IMAGE_MEDIE_WIDTH);
$upt->DeleteFile();
return $upt->filename;
} else {
$messaggio = 'Immagine non valida';
$upt->DeleteFile();
return $messaggio;
}
}
}