02-24-2010 06:41 AM
03-25-2010 02:31 PM
<?php
require_once "Alfresco/Service/Repository.php";
require_once "Alfresco/Service/Session.php";
require_once "Alfresco/Service/SpacesStore.php";
$repositoryUrl = "http://ALFPATH/alfresco/api";
$userName = "admin";
$password = "admin";
$repository = new Repository($repositoryUrl);
$ticket = $repository->authenticate($userName, $password);
$session = $repository->createSession($ticket);
$spacesStore = new SpacesStore($session);
$companyHome = $spacesStore->companyHome;
?>
<html>
<head>
<title>Upload</title>
</head>
<body>
<?php
if (isset($_POST["Submit"])) {
$fileName = $_FILES['uploadFile']['name'];
$fileType = $_FILES['uploadFile']['type'];
$HomePath = "app_company_home";
$contentNode = $companyHome->createChild("cm_content", "cm_contains", $HomePath);
$contentNode->cm_name = $fileName;
$contentNode->cm_title = "Title";
$contentNode->cm_description = "Description";
$contentData = $contentNode->setContent("cm_content", $fileType, "UTF-8");
$contentData->writeContentFromFile($_FILES['uploadFile']["tmp_name"]);
$session->save();
echo "Uploaded!";
}
else { ?>
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="uploadFile">
<input type="submit" value="Upload" name="Submit">
</form>
<?php } ?>
</body>
</html>
06-24-2010 07:38 AM
04-05-2011 02:49 AM
04-06-2011 11:37 AM
Thank you, but i get another error. I can upload a file, the file is also shown in Alfresco, but the file ist empty!
Know anybody the problem?
Regards, SF
10-20-2011 01:06 AM
Thank you, but i get another error. I can upload a file, the file is also shown in Alfresco, but the file ist empty!
Know anybody the problem?
Regards, SF
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.