ueditor圖片上傳配置

來源:互聯網
上載者:User

標籤:str   pos   regexp   隨機數   圖片路徑   儲存位置   設定圖   int   article   

ueditor圖片上傳設定檔為ueditor/php/config.json

/* 上傳圖片配置項 */    "imageActionName": "uploadimage", /* 運行上傳圖片的action名稱 */    "imageFieldName": "upfile", /* 提交的圖片表單名稱 */    "imageMaxSize": 2048000, /* 上傳限制大小,單位B */    "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上傳圖片格式顯示 */    "imageCompressEnable": true, /* 是否壓縮圖片,預設是true */    "imageCompressBorder": 1600, /* 圖片壓縮最長邊限制 */    "imageInsertAlign": "none", /* 插入的圖片浮動方式 */    "imageUrlPrefix": "http://www.xxx.cn", /* 圖片訪問路徑首碼 */    "imagePathFormat": "/uploads/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 已改路徑,上傳儲存路徑,能夠自己定義儲存路徑和檔案名稱格式 */                                /* {filename} 會替換成原檔案名稱,配置這項須要注意中文亂碼問題 */                                /* {rand:6} 會替換成隨機數,後面的數字是隨機數的位元 */                                /* {time} 會替換成時間戳記 */                                /* {yyyy} 會替換成四位年份 */                                /* {yy} 會替換成兩位年份 */                                /* {mm} 會替換成兩位月份 */                                /* {dd} 會替換成兩位日期 */                                /* {hh} 會替換成兩位小時 */                                /* {ii} 會替換成兩位分鐘 */                                /* {ss} 會替換成兩位秒 */                                /* 非法字元 \ : * ?

" < > | */ /* 具請體看線上文檔: fex.baidu.com/ueditor/#use-format_upload_filename */

有兩點須要注意
1、imagePathFormat,圖片路徑格式,配置此參數能夠設定圖片在server中的儲存位置
2、imageUrlPrefix。圖片訪問路徑首碼,通過配置此參數能夠和imagePathFormat構成圖片的絕對路徑
範例:http://www.xxx.cn/uploads/image/20150710/1436493278975924.jpg

ueditor圖片上傳配置

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.