This commit is contained in:
2025-07-04 09:50:02 +08:00
commit 3d800dbd11
2564 changed files with 1353015 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
namespace MyCode.Project.Infrastructure.Common
{
public class UploadFile
{
public static string Upload(HttpPostedFile file, string uploadPath)
{
try
{
var path = HttpContext.Current.Server.MapPath(uploadPath + file.FileName);
if (!Directory.Exists(HttpContext.Current.Server.MapPath(uploadPath)))
{
Directory.CreateDirectory(uploadPath);
}
file.SaveAs(path);
return path;
}
catch
{
return "error";
}
}
}
}