cancel
Showing results for 
Search instead for 
Did you mean: 

Auto-set mimetype for files added via CIFS

etech
Champ in-the-making
Champ in-the-making
Hi,

I would like to auto-set the mimetype for files that are uploaded via the CIFS file share. For example, all files dropped in the "textfiles" folder should have their mimetype set to "text/plain". I did this through the Share/UI by using a custom JavaScript that is run in a rule, but that doesn't apply to files added through CIFS. Here is what I did in the javascript:

<blockcode>document.mimetype = "text/plain";</blockcode>

Is there a similar way to do this for files added through CIFS?
1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator
Hello,

the cause why this doesn't work (in CIFS) may be that the mimetype is later reset by the system to the correct mimetype based on file inspection.
Why would you want to explicitly set a mimetype when the file can be of any type? Forcing an incompatible mimetype can lead to Alfresco not working with those files as expected, i.e. full text indexing, preview…

Regards
Axel