cancel
Showing results for 
Search instead for 
Did you mean: 

Problem uploading files via upload API

go4alfresco
Champ in-the-making
Champ in-the-making
Hello everybody,

I'm using API alfresco/service/api/upload which in the past worked quite well for some PHP file upload process. After upgrading to Alfresco 4.2.f this stopped working with an exception in log files.

Caused by: java.lang.IllegalArgumentException: Class {}message/rfc822 has not been defined in the data dictionary


I found that this has something to do with "contenttype" specified in the upload process.
If no "contenttype" is set or "contenttype" is set to "cm:content" the file upload works but everyting is handled as binary file.
While having some emails to be uploaded they are normaly identified as "message/rfc822", "text/x-news" or "text/x-mail" but non of these is beeing uploaded anymore.

Setting right "contenttype" is required so that type definition and preview is working in share still.

I checked configuration of 4.2.f system in comparision to 4.2.c system already and do not see any difference with regard to these types.

Does anybody know if 4.2.f changed something on api/upload or how to make api/upload running so that message/rfc822 "contenttype" can be uploaded again?

Many thanks
/M
1 REPLY 1

khoer52
Champ in-the-making
Champ in-the-making
Hello go4alfresco.
I got same issue about uploading file. Here i'm trying to share what i got, and i hope everyone correct me if i wrong.

Started on Alfresco 4.2 above in the release note has announced this new api service. THe difference between new api and the old one, beside the endpoint, the data format has changed too. Previous version used xml atom data and now use json data. Because of that, the parameter to upload has changed too but i dont found any documentation about how to write the parameter. Eventhough i've some threads, but there is no complete sample.
Is there something i missed? Please provide a sample how to write parameter json data completely.