删除已上传的文件unlink

发表于

            /*设置上传路径*/
            $savePath = SITE_PATH . ‘/data/upload/excel/forbidplayer/’;

            /*以时间来命名上传的文件*/
            $str       = uniqid() . date(‘Ymdhis’);
            $file_name = $str . “.” . $file_type;
            $myfile = $savePath . $file_name;
            if (file_exists($myfile)) {
                @unlink($myfile);
            }

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注