JumboTCMS_src/JumboTCMS.WebFile/admin/email_draft_upfile.aspx.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
* 程序名称: JumboTCMS(将博内容管理系统通用版)
*
* 程序版本: 7.x
*
* 程序作者: 子木将博 (QQ:791104444@qq.com,仅限商业合作)
*
* 版权申明: http://www.jumbotcms.net/about/copyright.html
*
* 技术答疑: http://forum.jumbotcms.net/
*
*/
using System;
using System.Web;
using System.IO;
using System.Data;
namespace JumboTCMS.WebFile.Admin
{
public partial class _email_draft_upfile : JumboTCMS.UI.AdminCenter
{
private string _AdminUploadPath;
private string _AdminUploadType;
private int _AdminUploadSize = 0;
protected void Page_Load(object sender, EventArgs e)
{
Admin_Load("ok", "html");
if (!(new JumboTCMS.DAL.AdminDAL()).ChkAdminSign(q("adminid"), q("adminsign")))
{
Response.Write("验证信息有误");
Response.End();
}
if (Request.Files.Count > 0)
{
HttpPostedFile oFile = Request.Files[0];//得到要上传文件
if (oFile != null && oFile.ContentLength > 0)
{
if (!JumboTCMS.Utils.FileValidation.IsSecureUploadPhoto(oFile))
Response.Write("不是安全的图片");
else
{
try
{
string fileExtension = System.IO.Path.GetExtension(oFile.FileName).ToLower(); //上传文件的扩展名
string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/upload_admin_other.config");
JumboTCMS.DBUtility.XmlControl XmlTool = new JumboTCMS.DBUtility.XmlControl(strXmlFile);
this._AdminUploadPath = XmlTool.GetText("Root/email_draft/path").Replace("<#SiteDir#>", site.Dir);
this._AdminUploadType = XmlTool.GetText("Root/email_draft/type");
this._AdminUploadSize = Str2Int(XmlTool.GetText("Root/email_draft/size"), 1024);
XmlTool.Dispose();
if (this._AdminUploadType.ToLower().Contains("*" + fileExtension + ";"))//检测是否为允许的上传文件类型
{
if (this._AdminUploadSize * 1024 >= oFile.ContentLength)//检测文件大小是否超过限制
{
string DirectoryPath;
DirectoryPath = this._AdminUploadPath + DateTime.Now.ToString("yyyy-MM");
JumboTCMS.Utils.DirFile.CreateDir(this._AdminUploadPath + DateTime.Now.ToString("yyyy-MM"));
string sFileName = sFileName = System.IO.Path.GetFileName(oFile.FileName);
string FullPath = DirectoryPath + "/" + sFileName;//最终文件路径
oFile.SaveAs(Server.MapPath(FullPath));
if (JumboTCMS.Utils.FileValidation.IsSecureUpfilePhoto(Server.MapPath(FullPath)))
后面还有 26 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。