09-30-2019 01:03 PM
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
10-02-2019 04:52 AM
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.
09-30-2019 02:13 PM
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: http://explorer.nuxeo.com/nuxeo/site/distribution/Nuxeo%20Platform%20LTS%202019-10.10/viewExtensionP...
10-01-2019 12:41 PM
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
10-01-2019 02:53 PM
It should be XPath
: file:content/mime-type
and with value image/vnd.dwg
10-02-2019 03:54 AM
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
10-02-2019 04:52 AM
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.
10-02-2019 06:46 AM
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" label="[[i18n('file.content')]]" name="content" document="{{document}}" accept=".dwg,.dxf,.dgn" message="Upload a CAD document"></nuxeo-dropzone>
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.