AnsweredAssumed Answered

[ASK] Uploading Doc With Image = Error

Question asked by pokcoy on Jan 4, 2009
Hi all,

does anybody know why if i upload a content within an image in header(*doc) into ALF, the error will appear.

if my code is:

$upload->cm_content = $content_data;
$content_data->mimetype = $_FILES['uploadedfile']['type']; // will be filled by "application/msword"
$content_data->encoding = "UTF-8";

then the result is:

Fatal error: Uncaught SoapFault exception: [soapenv:Server.generalException] (null) in C:\TEGUH\PROJECT\EL-NUSA\alfresco-php-library\Alfresco\Service\WebService\AlfrescoWebService.php:65 Stack trace: #0 C:\TEGUH\PROJECT\EL-NUSA\alfresco-php-library\Alfresco\Service\WebService\AlfrescoWebService.php(65): SoapClient->__soapCall('update', Array, Array, Array, Array) #1 C:\TEGUH\PROJECT\EL-NUSA\alfresco-php-library\Alfresco\Service\WebService\AlfrescoWebService.php(47): AlfrescoWebService->__soapCall('update', Array) #2 [internal function]: AlfrescoWebService->__call('update', Array) #3 C:\TEGUH\PROJECT\EL-NUSA\alfresco-php-library\Alfresco\Service\Session.php(168): AlfrescoWebService->update(Array) #4 C:\TEGUH\PROJECT\EL-NUSA\alfresco-php-library\alf\uploadFile.php(36): Session->save() #5 {main} thrown in C:\TEGUH\PROJECT\EL-NUSA\alfresco-php-library\Alfresco\Service\WebService\AlfrescoWebService.php on line 65

but if, i remove the image from the header suddenly this file is uploaded.

Then, if i changed my code into:

$content_data->mimetype = "application/octet-stream"; //change in here
$content_data->encoding = "UTF-8";
$upload->cm_content = $content_data;

the result is : succesfully in uploading.

But, the byte content of uploaded file will be 0 (zero) in it size.

Please Help Me…

Thank you very much.

Outcomes