AnsweredAssumed Answered

Upload from PHP

Question asked by claude22 on Jul 25, 2017
Latest reply on Jul 29, 2017 by gmasand09

Hello,

 

I would like to upload file in Alfresco using the REST API /alfresco/service/api/upload but I have always an error 500 with this message (06250305 Unexpected error occurred during upload of new content)

 

This is my code : 
    $destinationNodeRef = $this->getNodeRef($destinationPath);

    $type = "image/jpeg";

    $cfile = new CURLFile($filePath, $type);

    $curl = new Curl();  
    $response = $curl->post(
        $this->_alfUrl . '/alfresco/service/api/upload?alf_ticket=' . $_SESSION['alf_token'], array(     
        'filedata' => $cfile,
        'contenttype' => "cm:content",  
        'fileName' => $fileName,
        'destination' => $destinationNodeRef,
        'nodeRef' => $destinationNodeRef
        )
    );

 

$destinationNodeRef is something like : workspace://SpacesStore/f8f2fcb5-b64f-47f7-9b1c-f95b85460a58 

 

If someone could help me, it would be marvelous

Thanks

C.

Outcomes