• REST API exising file warning

  • 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.
 #43252  by openkm_user
 
Hi,

When we upload a file to OpenKM through REST API and if another file with same name already exists we are not able to check it before uploading, or is there any way that we are missing?

Thanks in advance!
 #43254  by openkm_user
 
Currently it returns only an exception like,

ItemExistsException: /okm:root/Portfolios/CRM039/CRM039_1/1018755685/address.txt when we try uploading address.txt in the mentioned path.

Response is not an XML or JSON, so we are not able to handle in this case. Or is there any way where we could search directly for files inside a path like above mentioned?
 #43266  by jllort
 
There's a method names hasNode(String nodeId), where the nodeId can be a path or UUID. If the node exists ( document, folder etc... you will get back a true value )
 #43270  by openkm_user
 
It returns true only when we give UUID, string is empty if we give path (our requirement is to give path only).

Please assist!
 #43281  by jllort
 
How are you accessing REST api ?
I have executed the query directly from browser because is a get method and is going right in both cases:
Code: Select all
http://localhost:8080/OpenKM/services/rest/repository/hasNode?nodeId=/okm:root/test1/
 #43292  by openkm_user
 
We were using SDK for PHP 1.0.1 before, now tried with SDK for PHP 1.1.1 and it works through REST API.

Thanks so much!

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.