• Downloading document via PHP

  • 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.
 #17223  by bburim
 
Hi!

Anyone has some ideas how to download the document from OpenKM via dav?
I use PHP, trying curl etc. but nothing's working...
Or maybe there is some better way instead of doing this via DAV?

The problem is that DAV is webauth-protected.
And the url of the following format:

https://[username]:[password]@[servername]:[port]/[filepath]

is treated as invald!

Please, express your opinions and share the ideas if there are some!
Thanks!
 #17226  by bburim
 
Hi again.
Seems that nobody has any ideas.
But I have found a solution of my problem and want to share it with others.
To download file, I use getContent() api method (http://localhost:8080/OpenKM/OKMDocument?wsdl).
It returns binary response whic can be written to disk, and it matches with my needs.

I hope wiki will be improved in future and other developers will not need to read the WSDL definition to find needed method by name as I did.
That's all.
Ask questions if interested.
 #17234  by jllort
 
if you put here a complete downloading example I will add in our wiki documentation available to all users.
 #17260  by pavila
 
The URL http://[username]:[password]@[servername]:[port]/[filepath] should work if the WebDAV is enabled and the path is correct.
 #20602  by olsonea
 
bburim,

Were you able to save the document locally on a client, or did you have to save the document on the server? My goal is to be able to prompt the user for a location on their workstation, and save to that path. If you are able, would you please share your solution in php? I'd prefer not to use WebDAV. Thanks!

-Eric
 #20611  by jllort
 
Please olsonea your questions seems going in other direction, please add new post for it indicating a more detailed description of what you got in mind ?

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.