BUG 9069 Add variable to path in alfresco SOLVED
- I add param in method uploadDoc, the param has the path in alfresco
This commit is contained in:
@@ -272,19 +272,19 @@ function getFolderChildren($alfrescoServerUrl, $folderId, $user, $pwd) {
|
||||
* @param string | $docType | Type of document to be Uploaded
|
||||
* @param string | $user | Valid Admin username to connect to Alfresco server
|
||||
* @param string | $pwd | Valid Admin password to connect to Alfresco server
|
||||
* @param string | $ubicacion | Path of document to be Uploaded
|
||||
* @param string | $path | Path of document to be Uploaded
|
||||
*
|
||||
* @return string | $result | Response
|
||||
*
|
||||
*/
|
||||
function uploadDoc($alfrescoServerUrl, $fileSource, $title, $description, $docType, $user, $pwd, $ubicacion = '') {
|
||||
function uploadDoc($alfrescoServerUrl, $fileSource, $title, $description, $docType, $user, $pwd, $path = '') {
|
||||
$filep = fopen($fileSource,"r");
|
||||
$fileLength = filesize($fileSource);
|
||||
$fileContent = fread($filep,$fileLength);
|
||||
$fileContent = base64_encode($fileContent);
|
||||
|
||||
$ubicacion = ($ubicacion != '') ? $ubicacion . PATH_SEP : $ubicacion;
|
||||
$alfresco_url = "$alfrescoServerUrl/s/cmis/p/Sites/" . $ubicacion . "children";
|
||||
$path = ($path != '') ? $path . PATH_SEP : $path;
|
||||
$alfresco_url = "$alfrescoServerUrl/s/cmis/p/Sites/" . $path . "children";
|
||||
$xmlData = array();
|
||||
$xmlData = '<?xml version="1.0" encoding="utf-8"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/"><title>'.$title.'</title><summary>'.$description.'</summary><content type="application/'.$docType.'">'.$fileContent.'</content><cmisra:object><cmis:properties><cmis:propertyId propertyDefinitionId="cmis:objectTypeId"><cmis:value>cmis:document</cmis:value></cmis:propertyId></cmis:properties></cmisra:object></entry>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user