UEditor 1.3.6 .NET版本 圖片上傳配置


Ueditor編輯器確實是非常好用,但是官方的使用文檔已經非常舊了,沒有及時更新,為了使用Ueditor編輯器,查了幾天資料終於配置成功!真不容易!

以下配置是把上傳的路徑放到根目錄下的Upload 文件夾內,默認的路徑放得太深入了。

后續我會加上生成縮略圖和添加水印。

 

UEditor 1.3.6 .NET版本圖片上傳配置:
1.把net文件夾下的image.ashx的頂部<%@ Assembly Src="Uploader.cs" %> 和<%@ Assembly Src="Config.cs" %> 去掉


2.把net文件夾下的 uploader.cs 上傳文件處理方法 public  Hashtable upFile(HttpContext cxt, string pathbase, string[] filetype, int size) 的 pathbase = pathbase + "/"; 改為:pathbase = pathbase + DateTime.Now.ToString("yyyy-MM-dd") + "/";

3.在net文件夾下的 uploader.cs 上傳文件處理方法 public  Hashtable upFile(HttpContext cxt, string pathbase, string[] filetype, int size) 的里面加上 uploadpath =uploadpath.Replace("ueditor\\net","");

 


4. 在ueditor.config.js文件中,圖片上傳配置區把imagePath: URL + "net/" 改為:  imagePath: URL.replace("ueditor/","")


 

文章來源:http://www.cnblogs.com/meishita/    到這里圖片上傳就修改成功了!

下面是圖片管理配置:
1.ueditor.config.js文件中,圖片在線管理配置區把imageManagerPath: URL + "net/"改為:  imageManagerPath: URL.replace("ueditor/", "")


2.imageManager.ashx 中,把 DirectoryInfo info = new DirectoryInfo(context.Server.MapPath(path));改為:DirectoryInfo info = new DirectoryInfo(context.Server.MapPath(path).Replace("ueditor\\net\\", ""));

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM