瀏覽代碼

[签证图片上传格式改为JPEG]

jiangjc 1 年之前
父節點
當前提交
3f4f934bd6
共有 2 個文件被更改,包括 5 次插入4 次删除
  1. 4 4
      OASystem/OASystem.Api/Controllers/GroupsController.cs
  2. 1 0
      OASystem/OASystem.Api/appsettings.json

+ 4 - 4
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -578,9 +578,9 @@ namespace OASystem.API.Controllers
                 System.IO.MemoryStream ms = new System.IO.MemoryStream(arr);//转换成无法调整大小的MemoryStream对象
                 bitmap = new System.Drawing.Bitmap(ms);//将MemoryStream对象转换成Bitmap对象
 
-                var fileDir = AppSettingsHelper.Get("VisaProgressImageFtpPath");
+                var fileDir = AppSettingsHelper.Get("VisaProgressImageBasePath");
                 //文件名称
-                filename = "VisaProgress_" + DateTime.Now.ToString("yyyyMMddHHmmss") + "_" + imgName + ".jpg";//所要保存的相对路径及名字
+                filename = "VisaProgress_" + DateTime.Now.ToString("yyyyMMddHHmmss") + "_" + imgName + ".png";//所要保存的相对路径及名字
                 //上传的文件的路径
                 string filePath = "";
                 if (!Directory.Exists(fileDir))
@@ -593,10 +593,10 @@ namespace OASystem.API.Controllers
                 //string url = HttpRuntime.AppDomainAppPath.ToString();
                 //string tmpRootDir = System.Web.HttpContext.Current.Server.MapPath(System.Web.HttpContext.Current.Request.ApplicationPath.ToString()); //获取程序根目录 
                 //string imagesurl2 = tmpRootDir + filename; //转换成绝对路径 
-                //bitmap.Save(filePath, System.Drawing.Imaging.ImageFormat.Jpeg);//保存到服务器路径
+                bitmap.Save(filePath, System.Drawing.Imaging.ImageFormat.Jpeg);//保存到服务器路径
                 //bitmap.Save(filePath + ".bmp", System.Drawing.Imaging.ImageFormat.Bmp);
                 //bitmap.Save(filePath + ".gif", System.Drawing.Imaging.ImageFormat.Gif);
-                bitmap.Save(filePath + ".png", System.Drawing.Imaging.ImageFormat.Png);
+                //bitmap.Save(filePath, System.Drawing.Imaging.ImageFormat.Png);
                 ms.Close();//关闭当前流,并释放所有与之关联的资源
                 bitmap.Dispose();
             }

+ 1 - 0
OASystem/OASystem.Api/appsettings.json

@@ -122,6 +122,7 @@
   "GrpFileBasePath": "C:/Server/File/OA2023/Office/GrpFile/",
 
   "VisaProgressImageBaseUrl": "http://132.232.92.186:24/",
+  "VisaProgressImageBasePath": "C:/Server/File/OA2023/Image/Visa/",
   "VisaProgressImageFtpPath": "Image/Visa/",
 
   "WageSheetExcelBaseUrl": "http://132.232.92.186:24/",