Page 1 of 1

REST API exising file warning

PostPosted:Mon Feb 20, 2017 11:25 am
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!

Re: REST API exising file warning

PostPosted:Mon Feb 20, 2017 1:30 pm
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?

Re: REST API exising file warning

PostPosted:Tue Feb 21, 2017 7:34 pm
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 )

Re: REST API exising file warning

PostPosted:Wed Feb 22, 2017 8:41 am
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!

Re: REST API exising file warning

PostPosted:Thu Feb 23, 2017 6:06 pm
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/

Re: REST API exising file warning

PostPosted:Fri Feb 24, 2017 11:38 am
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!

Re: REST API exising file warning

PostPosted:Sat Feb 25, 2017 7:54 am
by jllort
Might be a bug, althought in the change log has not been added any reference about it https://docs.openkm.com/kcenter/view/sd ... on-1x.html