• Possible to ignore file extension capitalization?

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #42904  by alexwgordon
 
Hi all,
We're running into the problem of file extensions having different capitalization, i.e. .PDF versus .pdf. Some users have reported issues updating files with different capitalization. Is there a way to ignore the file extension capitalization? Thanks!
 #42908  by jllort
 
Which OpenKM version are you using ?

Looking in the source code
Code: Select all
String mimeType = MimeTypeConfig.mimeTypes.getContentType(name.toLowerCase());
Seems the identification of document type is case insensitive. The document name is always converted to lowercase ( all mime types definition provided by default are lowercase ) and then identified. Can you explain with more detail the behaviour, some screenshot is always wellcome for better understanding.
 #42919  by alexwgordon
 
Okay so my OKM instance treats files with different file extension capitalization as two different files and won't upload over the other one. I'm running a workflow that checks if a file exists and it currently treats them as different files as well. But the root cause of it is still that my OKM installation doesn't convert to lowercase. Where can change this attribute?
 #42927  by jllort
 
If I understood you have a file name "name.AAA" yet existing in the OpenKM and as a workflow process step you are trying to upload a file named "name.aaa", then it raises and error, is that ?

If this is your scenario, you can disable the filename check with the Administration > Configuration parameter named
Code: Select all
system.document.name.mismatch.check=false
 #42940  by jllort
 
Yes, enabling it solves a kind of problem but can create new ones. The other solution is modifying source code to force all documents name be lowercase. I can guide about how doing it.
 #42955  by jllort
 
Have two options:
Take a look at DbDocumentModule.java ( see create, rename and update , line 95, 331, 828)

Probably the easiest is modify PahtUtils class the method named escape:
Code: Select all
public static String escape(String name) {
		String ret = cleanup(name);

		// Fix XSS issues
		ret = Encode.forHtml(ret);

		return ret.toLoweCase();
	}
The problem is the method espace is executed from a lot of places, for example, creating folder etc... here you are forcing a lot of things to being lowercase.

If you do not have portable developement environment you can download from here https://sourceforge.net/projects/openkmportabledev/

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.