cancel
Showing results for 
Search instead for 
Did you mean: 

Get MimeTypes using PHP

devmehta555
Champ in-the-making
Champ in-the-making
Hi Everybody,

I am trying to integrate alfresco to my php application through API.
Can anyone help me that how can I get all mimetypes available in alfresco dynamically?

Thanks in Advance,
Devang Mehta
6 REPLIES 6

sujaypillai
Confirmed Champ
Confirmed Champ
Hello Devang,

If you are working on Alfresco 3.4 or greater you may find all the mimetypes at
http://<servername>:<port>/alfresco/service/mimetypes

This will list all the currently registered mimetypes, and provide a details link for each one. Make a call to this Webscript through your API and that should work fine.


Thanks,

devmehta555
Champ in-the-making
Champ in-the-making
yes , It works!!!
Thanks.

devmehta555
Champ in-the-making
Champ in-the-making
It's working for 3.4 or higher versions.
What if instance is of version 3.2 or 3.3?

mrogers
Star Contributor
Star Contributor
You may be able to "backport" some of the code.   However its probably easier to upgrade.

devmehta555
Champ in-the-making
Champ in-the-making
Thanks,

in 3.4 or higher version I can easily get list of all register mimetypes.
Detail : http://<servername>:<port>/alfresco/service/mimetypes.  Thanks to sujaypillai.
And what if I want to get mimetype description to display in detail view.
Foe eg. for image/jpeg, we are displaying JPEG Image OR application/pdf, we are displaying Adobe PDF Document

So is there any dynamic way to get this description?

sujaypillai
Confirmed Champ
Confirmed Champ
Don't think so there is a dynamic way. Even in share-forms they use static reference [e.g. tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\controls\mimetype.ftl].

I am trying my hands on it… Will update you soon.


Thanks,