02-19-2015 11:34 AM
Hi,
I'm using File in nuxeo studio to upload file.
How to can I upload only the .doc or .pdf file when I upload a file ?
I would like upload only the .doc or pdf file.
Thanks a lot.
11-12-2015 10:55 AM
You can create your own custom widget based on extended_file_widget.
In the create/edit part of the widget, at the bottom, you can add a validateFileMimetype mark to limit which formats can be uploaded. This last page gives you an example at the top.
02-12-2016 05:23 AM
Create a new widget type "mywidget" . Define
<property name="template">/widgets/mywidget_widget_template.xhtml</property>
in the widget type.
Restrict the extensions that you want in mywidget_widget_template.xhtml file
<c:set var="acceptedExtensions"
value="#{nxu:test(!empty widgetProperty_acceptedExtensions, widgetProperty_acceptedExtensions, '.jpg, .jpeg, .png, .gif, .tif, .tiff, .psd, .raw, .ai, .svg, .ps, .eps, .epsi, .epsf, .xcf, .bmp')}" />
<nxu:inputFile id="#{widget.id}" value="#{field}"
filename="#{field.filename}" required="#{widgetProperty_required}" editFilename="false"
onclick="#{widgetProperty_onclick}" onchange="#{widgetProperty_onchange}">
</nxu:inputFile>
That's all. Hope this helps 🙂 Happy Development 😉
Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.
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.