As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
//Repository URL $alfURL="http://xcm:80/alfresco/api"; //User $alfUser=""; $alfPassword=""; //ID of the PARANT FOLDER $parantID="f93f665c-508b-11dc-800c-d5564c95a581"; $fname=$_FILES['ALF']['name']; $ftmp=$_FILES['ALF']['tmp_name']; $ftype=$_FILES['ALF']['type']; // Create the session $repository = new Repository($alfURL); $ticket = $repository->authenticate($alfUser, $alfPassword); $mysession = $repository->createSession($ticket); $store=new SpacesStore($mysession); $node=$mysession->getNode($store,$parantID); $upload=$node->createChild('cm_content','cm_contains',"$fname"); $contentData=new ContentData($upload,"{http://www.alfresco.org/model/content/1.0}content"); //$contentData=$upload->cm_content; $contentData->mimetype = $ftype; $upload->cm_name="$fname"; $contentData->encoding = "UTF-8"; $contentData->writeContentFromFile("$ftmp"); $upload->cm_content=$contentData; $mysession->save(); echo "done";
<html> <head></head> <body> <form enctype="multipart/form-data" action="uploadContent.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form> </body> </html>
<?php require_once 'Alfresco/Service/WebService/WebServiceFactory.php'; require_once 'Alfresco/Service/Repository.php'; require_once 'Alfresco/Service/SpacesStore.php'; $repoURL = "http://localhost:8080/alfresco/api"; $userName = "admin"; $password = "admin"; $repository = new Repository($repoURL); $ticket = $repository->authenticate($userName,$password); $session = $repository->createSession($ticket); $spacesStore = new SpacesStore($session); $companyHome = $spacestore->companyHome; $currentNode = null; $currentNode = $spacesStore->companyHome; $path = 'Company Home'; $upload = $currentNode->createChild('cm_content', 'cm_contains', 'cm_'.$_FILES['uploadedfile']['name']); $pathFile = $_FILES['uploadedfile']['tmp_name']; $content_data = new ContentData($upload, $property, $mimetype, $encoding); $content_data->mimetype = $_FILES['uploadedfile']['type']; $content_data->encoding = "UTF-8"; $content_data->writeContentFromFile($pathFile); $upload->cm_content = $content_data; $upload->cm_name = $_FILES['uploadedfile']['name']; echo $upload->cm_name; $session->save(); ?>
http://localhost:9090/alfresco/wsdl/authentication-service.wsdl
where we have to execute the code the php file
can u please me in detail regarding this or mail me at gaurav.masand09@gmail.com