//文件域的名字
//处理方法
//新图
if(!empty($_FILES['attach']['tmp_name']) && is_uploaded_file($_FILES['attach']['tmp_name'])){
$query = DB::query("select filename,filepath from pre_home_hall_pic where picid =$picid ");
while ($value = DB::fetch($query)) {
$oldfilepath=$value['filepath'];
$filename =$value['filename'];
}
$file_info = pathinfo($_FILES['attach']['name']);
$ext = $file_info['extension'];// 取扩展名
$filepath = dirname($oldfilepath).'/'.date('His').strtolower(random(16)).'.'.$ext;//随机重命名
$uploadpath = 'data/attachment/hall/'.$filepath;
if(!is_dir('data/attachment/hall/'.$oldfilepath)){
unlink('data/attachment/hall/'.$oldfilepath);
unlink('data/attachment/hall/'.$oldfilepath.'.thumb.jpg');
}
$res = move_uploaded_file($_FILES['attach']['tmp_name'], $uploadpath);
if($res){
require_once libfile('class/image');
$image = new image();
$result = $image->Thumb($uploadpath, '', 140, 140, 1);
}
$data['filename'] = $_FILES['attach']['name'];
$data['filepath'] = $filepath;
}
DB::update('home_hall_pic', $data, $wherearr);
本网站采用OpenWBS 企业建站系统开发的网站模版,支持PC端+手机端。适合做公司网站企业网站,特别适合做工程和机械类公司网站。 OpenWBS企业建站系统是一款功能强大的企业建站内容管理系统,专业用于企业网站建设和企业网站制作,面向广大企业用户,帮助企业快速搭建企业官网,不论你是技术大咖还是建站小白,都可以使用企业建站系统快速搭建一个功能齐全的企业网站,非常适合 做公司网站、企业网站、政
0
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号