Page 1 of 1

Downloading document via PHP

PostPosted:Thu Jul 19, 2012 10:36 am
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!

Re: Downloading document via PHP

PostPosted:Thu Jul 19, 2012 6:24 pm
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.

Re: Downloading document via PHP

PostPosted:Fri Jul 20, 2012 4:01 pm
by jllort
if you put here a complete downloading example I will add in our wiki documentation available to all users.

Re: Downloading document via PHP

PostPosted:Mon Jul 23, 2012 8:50 pm
by pavila
The URL http://[username]:[password]@[servername]:[port]/[filepath] should work if the WebDAV is enabled and the path is correct.

Re: Downloading document via PHP

PostPosted:Mon Oct 29, 2012 12:24 pm
by bburim
Find a solution. If someone interested. http://stackoverflow.com/questions/1312 ... h-and-port

Re: Downloading document via PHP

PostPosted:Mon Oct 29, 2012 6:25 pm
by pavila
Thanks for sharing.

Re: Downloading document via PHP

PostPosted:Sat Jan 05, 2013 11:11 pm
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

Re: Downloading document via PHP

PostPosted:Sun Jan 06, 2013 6:17 pm
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 ?