In the use of the Ueditor editor, we usually need to modify the default image upload path, the following is my revised location and methods for reference.
Ueditor PHP version itself with a set of upload program, we can find a configuration file to modify it on this basis. Configuration file Location:
* * 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 * * "Imagefieldnam E ":" "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 ": 1600,/* picture compression most Long-edge Limit/"Imageinsertalign": "None", * * Insert the picture floating mode * * "Imageurlprefix": "",/* Picture access Path prefix * * "Imagepathformat": "/uedito R/php/upload/image/{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 filename, configure this Items 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 digits/* {time} will be replaced with timestamp * * * {yyyy} will replace the four-bit year/////////* {YY} will be replaced by two-bit year * * * {mm} will be replaced by two-bit month/* {DD} will be replaced by two-bit
The date///* {HH} will be replaced by two-bit hours/* {II} will be replaced by two-bit minutes/* {SS} will be replaced by two-digit seconds * * /* Illegal characters \: *? " < > | * * * To see the online document: fex.baidu.com/ueditor/#use-format_upload_filename * * * * Graffiti picture upload Configuration Items * * * Scrawlactionnam E ":" "uploadscrawl", * * Execute upload Graffiti action name * * "Scrawlfieldname": "Upfile", * * submitted picture form name * * * "Scrawlpathformat": "/ueditor/p Hp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6} ",/* Upload save path, you can customize the save path and filename format * *" scrawlmaxsize ": 2048000,/* Upload size limit, Unit B * /"Scrawlurlprefix": "",/* Picture access Path prefix * * "scrawlinsertalign": "None", * * screenshot tool upload/"snapscreenactionname": "Upload Image ", * * Execute the upload screenshot of the action name * *" Snapscreenpathformat ":"/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6} ", *
Upload the save path, you can customize the save path and filename format * * "Snapscreenurlprefix": "", * * Image access Path prefix/"snapscreeninsertalign": "None", * * inserted picture floating mode * * /* Crawl Remote Picture configuration * * "Catcherlocaldomain": ["127.0.0.1", "localhost", "img.baidu.com"], "catcheractionname": "Catchimage", /* Execute crawl remote picture's action name/"Catcherfieldname": "Source",/* Submit the Picture List form name * * "Catcherpathformat": "/ueditor/php/upload/ima GE/{YYYY}{MM}{DD}/{time}{rand:6} ",/* Upload save path, you can customize the save path and file name 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 * * * videoactio Nname ":" "Uploadvideo", * * Execute 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 file name format * *" Videourlprefix ":" ",/* Video access Path prefix/*" VI Deomaxsize ": 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 implementation of the upload video action name * * * "filefieldname": "Upfile", * * submitted document FORM name * * " Filepathformat ":"/ueditor/php/upload/file/{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 ",". jpeg ",". gif ",". bmp ",". FL V ",". SwF ",". mkv ",". avi ",". 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 "],/* Upload file format Display//* List the pictures under the specified directory/*" Imagemanageractionname ":" Listimag E ",/* Execute Picture Management action name * *" Imagemanagerlistpath ":"/ueditor/php/upload/image/",/* Specify the directory to list the Pictures/*" Imagemanagerlistsize
": 20,/* Each listing the number of documents/" Imagemanagerurlprefix ":" ",/* Image access Path prefix/" imagemanagerinsertalign ":" None ", * * Insert the picture floating mode * * "Imagemanagerallowfiles": [". png", ". jpg", ". jpeg", ". gif", ". bmp"],/* listed file types/* list files in the specified directory/* "Filemanageracti Onname ":" ListFile ", * * Execute File Management action name/" Filemanagerlistpath ":"/ueditor/php/upload/file/",/* Specify directories to list files/*" Filem Anagerurlprefix ":" ", * * File access Path prefix * * "filemanagerlistsize": 20,/* The number of documents per list/"Filemanagerallowfiles": [". png", ". jpg", ". jpeg", ". gif", ". bmp", ". flv", ". SwF", ". mkv", ". avi", ". 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 */}
From the Config.json content, we can easily see (all have comments, see the Ghost of the->_->), almost all of the upload configuration is here. If you want to modify the upload path, you can do so by modifying the 12th line of the file.
It can be seen at this point that the modification was successful.
Upload configuration This, will be due to ueditor version, and slightly different, I just started in the new version of the response came, Root ediscovery just found here, we should also pay attention to the changes in the time Oh.
In addition, if you need to modify other uploads, such as video, you can also modify the file here, the truth is the same.