cancel
Showing results for 
Search instead for 
Did you mean: 

access alfresco through my php site

cristianfrog
Champ in-the-making
Champ in-the-making
Hi all,

I need to communicate with alfresco through a PHP client, in my case is a web site. My goal is to access the repository, get an HTML file and load it in my website, so basically I will use Alfresco as admin panel backend where I create my html pages.

I know there is some material about this, I read it and test but didn't make it working.

https://forums.alfresco.com/forum/general/non-technical-alfresco-discussion/possible-ways-build-enga...
jpotts here writes some solutions, I tried the ifresco php library and the php-alf-cmis-api from here:
https://code.google.com/p/php-alf-cmis-api/

But they doesn't work with Alfresco 5, giving me php errors about connection. So I read that the best solution may be using CMIS PHP Client but didn't found an example about it… is the cmis client this one:

http://chemistry.apache.org/php/phpclient.html
???

How can I connect with this and download/get a file and his properties?
<strong>Can someone provide me a working example in php about this? </strong>
13 REPLIES 13

I retested it on another server and it seems to "connect" now, but it gives me this error:
<strong>Failed to get metadata from Alfresco. Code: 401</strong>

The error is "Authorization required", are you sure this works without alf_ticket ??
Your script seems to send the JsessionID, but it seems not working… can you tell me how it authenticate and make it work?

Because its a "get" you are sending the UID & PWD in the http request so you don't need alf_ticket as it uses the credentials passed in the URL. This is a standard mechanism for running a get request, you can do it from the browser.

I suspect your problem is that, so far as I can see, you are not setting $getUIDPWD to anything; it should be set to

$getUIDPWD = sprintf("%s:%s",$repo_username, $repo_password);

SOLVED! I was using the POST getUIDPWD, thank you very much!

cristianfrog
Champ in-the-making
Champ in-the-making
I would definetly try it and let you know, thank you very much!