Force upload extension

Hello community !

I am trying to force an extension while uploading my file on a local document type. I want to know if it is possible. And if yes, where I can write the mime-type wanted ?

Thank you

0 votes

6 answers



If you need to block the upload if the mime-type is not the good one, then I think you should have controls on the UI side, i.e. on your import layout, in the Polymer section.

0 votes

It should be XPath : file:content/mime-type and with value image/vnd.dwg

1 votes

Hello Ahmed,

Have you tried to run a Document.SetProperty on “file:content”: { “mime-type”: “XXX” } field and update the mimetype with your value? (For example on the documentCreated event with a filter on your custom doctype?)

You can also run a new converter through the following extension point:–converter

1 votes

Thank you very much Mr Gregory,

I have resolved the problem by adding the parameter accept with the wanted extensions to the nuxeo-dropzone tag in create-layout:

<nuxeo-dropzone role="widget"
                message="Upload a CAD document"></nuxeo-dropzone>
0 votes

Thank you very much Mr Gregory, the mime-type is set exactly as I want. It would be better for me to block upload event when mime-type is different from the ones wanted. I think that running a script would help me. I don't know only the action that blocks the creation event if conditions are not satisfied.

Thank you

0 votes

Hello Mr Gregory,

Thank you for your answer. I have tried the first proposition by creating an event handler where the current document has my local custom document type. And the event handler execute an automation chain that uses Document.SetProperty (as seen in the screenshot) An error is occuring while uploading my document type exactly in the value: {“mime-type”: “XXX” }:

org.nuxeo.ecm.automation.OperationException: Only scalar types can be set using update operation


Please tell me if the process is correct.

Thank you very

FILES:   cadChain.png
0 votes