Functional requirements: Because the Ueditor is uploaded to the local, if the picture is deployed to a single server, you need to modify the original code
First look at Baidu official how to operate: http://fex.baidu.com/ueditor/#dev-crossdomain
Directly on the code: (Hint: If you do not understand this article, can be positive message, I see the first time after the reply)
1: After the ueditor environment is built, Ueditor can be used to copy a ueditor/php folder to picture server after basic use. A copy is to upload the image of the local access to the image Server controller class upload operation
2: The main modified documents:
A) ueditor/ueditor.config.js documents,
1, declare a remote URL, I write here is Lurl, address is http://l.bbs.com/(this address is the image server address)
2, add the remote URL that you just declared on the ServerURL address.
b) Ueditor/php/config.json Documents
Major modification places are:
"Imageurlprefix": "http://l.bbs.com/", * * Image access Path prefix * * *
screenshot tool upload/* "
snapscreenactionname": "Uploadimage", * Execute the upload screenshot of the action name * * "
Snapscreenpathformat": "Http://l.bbs.com/upload/{yyyy}{mm}{dd}/{time}{rand:6}",/* Upload save path, Can customize save path and filename format * *
crawl remote picture configuration/* "
catcherlocaldomain": ["127.0.0.1", "localhost", "img.baidu.com", "" L.bbs.com "],
" catcheractionname ":" Catchimage ",/* Execute crawl remote picture's action name * *"
catcherfieldname ":" Source ",/* Submitted Picture List Form name * * "
Catcherpathformat": "Http://l.bbs.com/upload/{yyyy}{mm}{dd}/{time}{rand:6}",/* Upload save path, Can customize save path and filename format * * * Upload file Configuration * * * "
fileactionname": "UploadFile", * * Controller, execute the action name of the upload video * * *
Filefieldname ":" Upfile ", * * submitted document FORM name * * *"
Filepathformat ":" http://l.bbs.com/upload/{yyyy}{mm}{dd}/{time}{ Rand:6} ",/* Upload save path, you can customize the save path and file name format * *
c) ueditor/php/controller.php Add Cross-domain functionality
Header (' access-control-allow-origin: * '); Set http://www.baidu.com to allow Cross-domain access to
header (' Access-control-allow-headers:x-requested-with,x_requested_with '); To set the allowed cross domain header
OK, after the completion of the above several operations, you can upload the image remotely, the small partners began to operate it
------------------------------------------------------Gorgeous split Line------------------------------------------------------------- --
Here is the complete Ueditor/php/config.json code
* * Front and back end communication-related configuration, note only allow multiple lines/{/* Upload picture Configuration Items * * "Imageactionname": "Uploadimage", * * Upload the image of the action name * * "Imagefie Ldname ":" Upfile ", * * submitted picture form name * * *" imagemaxsize ": 2048000,/* Upload size limit, Unit b * *" imageallowfiles ": [". png ",". jpg "," . jpeg ",". gif ",". bmp "],/* Upload picture format display/" Imagecompressenable ": true,/* Whether compression picture, the default is True */" Imagecompressborder ": 1 600,/* picture compression longest edge limit/"Imageinsertalign": "None", * * Insert the picture floating mode * * "Imageurlprefix": "http://l.bbs.com/",/* Picture access Path before Prefix *////* "Imagepathformat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", Upload save path, you can customize the save path and filename format * * "I Magepathformat ":" Upload/{yyyy}{mm}{dd}/{time}{rand:6} ",/* Upload save path, you can customize the save path and file name format * * *
filename} will be replaced by the original file name, configure this need to pay attention to the Chinese garbled problem * * * {rand:6} will be replaced by random number, the following number is the number of random number of digits * *
/* {time} will be replaced with a timestamp///////* {YYYY} for four-bit year * *
/* {YY} will be replaced by two-bit year * * /* {mm} will be replaced by the two-bit month/* {DD} will be replaced by two-digit date * * /* {HH} will be replaced by two-bit hours////{II} will replace for two-bit minutes/* {SS} will be replaced by two-digit/* illegal characters \: *? "< > |
* * * To see the online document: fex.baidu.com/ueditor/#use-format_upload_filename * * * * Graffiti picture upload configuration Items * * "Scrawlactionname": "Uploadscrawl", * * Execute upload Graffiti Action name * * * "scrawlfieldname": "Upfile", * * submitted picture form name * * * "SCRA Wlpathformat ":"/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6} ",/* Upload save path, you can customize the save path and file name format * * Scrawlpathformat ":"/file/ueditor/images/{yyyy}{mm}{dd}/{time}{rand:6} ",/* Upload save path, you can customize the save path and file name format * *
Scrawlmaxsize ": 2048000,/* Upload size limit, Unit b/" Scrawlurlprefix ":" ", * * Image access Path prefix * *" scrawlinsertalign ":" None ", /* screenshot tool upload/"Snapscreenactionname": "Uploadimage", * * Execute upload screenshot of the action name * * SnapscreenpathformaT ":" "Http://l.bbs.com/upload/{yyyy}{mm}{dd}/{time}{rand:6}",/* Upload save path, you can customize the save path and filename format * * "Snapscreenurlprefix": "", /* Picture access Path prefix/"snapscreeninsertalign": "None", * * Insert the picture floating mode * * Crawl remote picture configuration/* "Catcherlocaldomain": [127.0. 0.1 "," localhost "," img.baidu.com "," l.bbs.com "]," catcheractionname ":" Catchimage ",//* Execute crawl remote picture's action name */" catch Erfieldname ":" Source ", * * submitted picture List form name * *" Catcherpathformat ":" Http://l.bbs.com/upload/{yyyy}{mm}{dd}/{time}{rand:6 ",/* Upload the save path, you can customize the save path and filename format * *" Catcherurlprefix ":" ", * * Image access Path prefix/" catchermaxsize ": 2048000,/* Upload size limit, Unit B * /"Catcherallowfiles": [". png", ". jpg", ". jpeg", ". gif", ". bmp"],/* Crawl picture format display *//* Upload VIDEO Configuration * * * Videoactionnam E ":" "Uploadvideo", * * to perform the upload video action name * * "Videofieldname": "Upfile", * * submitted video form name * * * "Videopathformat": "/ueditor/
Php/upload/video/{yyyy}{mm}{dd}/{time}{rand:6} ",/* Upload save path, you can customize the save path and filename format * *" Videourlprefix ":" ",/* Video access Path prefix * * "Videomaxsize": 102400000, /* Upload size limit, Unit B, default 100MB * * "videoallowfiles": [". flv", ". SwF", ". mkv", ". avi", ". Rm", ". rmvb", ". Mpeg", ". mpg" , ". Ogg", ". Ogv", ". mov", ". wmv", ". mp4", ". WebM", ". mp3", ". wav", ". Mid"],/* Upload video format display/* Upload file Configuration * * * Fileactionname ":" UploadFile ",/* Controller, the action name of the upload video/" Filefieldname ":" Upfile ", * * submitted file Form name * * *" Filep Athformat ":" Http://l.bbs.com/upload/{yyyy}{mm}{dd}/{time}{rand:6} ",/* Upload save path, you can customize the save path and file name format * *" Fileurlprefix ":" " ,/* File access Path prefix * * "filemaxsize": 51200000,/* Upload size limit, Unit B, default 50MB * * "fileallowfiles": [". png", ". jpg", ". JP Eg ",". gif ",". bmp, ". flv", ". SwF", ". mkv", ". avi", ". Rm", ". rmvb", ". Mpeg", ". mpg", ". Ogg", ". Ogv", ". Mo
V ",". wmv ",". mp4 ",". WebM ",". mp3 ",". wav ",". Mid ",". rar ",". zip ",". Tar ",". Gz ",". 7z ",". bz2 ",". Cab ",". ISO ", ". Doc", ". docx", ". xls", ". xlsx", ". ppt", ". pptx", ". pdf", ". txt", ". MD", ". Xml"],/* Upload file format display */* list The picture under the specified directory * * ImagemanAgeractionname ":" ListImage ",/* Execute Picture Management action name * *" Imagemanagerlistpath ":"/ueditor/php/upload/image/", * Specify the order of the picture to be listed Record * * "imagemanagerlistsize": 20,/* Each listing the number of documents/"Imagemanagerurlprefix": "", * * Image access Path prefix * * imagemanagerinser
Talign ": None", * * Insert the picture floating mode * * * "imagemanagerallowfiles": [". png", ". jpg", ". jpeg", ". gif", ". bmp"],//* listed file Types * * /* List the files in the specified directory/"Filemanageractionname": "ListFile",//* Execute File Management action name * * "Filemanagerlistpath": "/ueditor/ph p/upload/file/", * Specify the directory to list files/" Filemanagerurlprefix ":" ",/* file access Path prefix/" filemanagerlistsize ": 20,/* Number of files per listing Amount of "filemanagerallowfiles": [". png", ". jpg", ". jpeg", ". gif", ". bmp", ". flv", ". SwF", ". mkv", ".
",". Rm ",". rmvb ",". Mpeg ",". mpg ",". Ogg ",". Ogv ",". mov ",". wmv ",". mp4 ",". WebM ",". mp3 ",". wav ",". Mid ", ". rar", ". zip", ". Tar", ". Gz", ". 7z", ". bz2", ". Cab", ". iso", ". Doc", ". docx", ". xls", ". xlsx", ". ppt", ". pptx" , ". pdf", ". txt", ". MD", ". Xml"]//* listed file types */}