09-02-2007 09:51 AM
09-03-2007 07:07 AM
09-09-2007 07:42 AM
09-09-2007 11:19 AM
09-10-2007 08:48 AM
//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";
02-11-2008 09:19 AM
08-11-2008 01:50 PM
07-06-2017 03:38 AM
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
10-06-2008 07:38 AM
11-23-2008 03:43 PM
<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();
?>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.