Background:
If you are using a UNIX system such as Mac or Ubuntu, you must know that the UNIX system file path delimiter is / and the Windows System file delimiter is \
When you set the jeesite.properties in the
userfiles.basedir= D\:\\workspace\\jeesite
If not set, the upload path will be: dir = servletcontextfactory.getservletcontext (). Getrealpath ("/");
If you are using the Windows operating system, the future program will also be deployed on the Windows operating system, you can see here, stop, interested students can continue.
Thinkgen, this guy wrote a Ckfinder configuration class.
com . Thinkgem . Jeesite . Common . Web . Ckfinderconfig
Inherited the
com . Ckfinder . connector . Configuration . Configuration
To complete the configuration of the entire project by jeesite.properties a configuration file. It's really a comprehensive consideration. But here's the problem.
If you configure an absolute UNIX path here: For example,/user/jeesite will be converted to the relative path of the user/jeesite.
Say so much about how to solve the whole problem, then?
1. Find:
com . Thinkgem . Jeesite . Common . Utils . Fileutils.java
Modify the Path method: Add 15-17 lines and finish.
2. Test your program.
1 /**2 * fix path, replace \ \ or/etc with File.separator3 * @paramPath4 * @return5 */6 Public Staticstring Path (string path) {7String p = stringutils.replace (path, "\ \", "/");8p = stringutils.join (Stringutils.split (P, "/"), "/");9 if(! Stringutils.startswithany (P, "/") && Stringutils.startswithany (path, "\ \", "/")){Tenp + = "/"; One } A if(! Stringutils.endswithany (P, "/") && Stringutils.endswithany (path, "\ \", "/")){ -p = p + "/"; - }if (Path.startswith ("/")) {p = "/" + p;17} - returnp; +}
Jeesite ckfinder mac/linux File upload path settings