Hi Shaan,
The best way to do this is by using a non-persistent verification entity. This can be configured within the ‘Verification before upload’ tab in the file dropper widget settings. On upload, the file dropper widget will create a verification object, set the file extension in the chosen extension attribute and will call a microflow/nanoflow in which you can verify whether the file may be uploaded or not. I recommend to use a nanoflow for this, which simply checks if the file extension is ‘txt'. The nanoflow needs to return a string as result. If the string is ""
or empty
, the file will be uploaded. If the string contains text, this will be used as an error message.
For further information, see the documentation in the widget settings, the set-up is well explained there:
Hope this helps!
Hi Shaan,
One thing you can do is in the ‘Restrictions’ tab, accept only text/plain as mime type.
As you can see here:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
The other solution is do a check in the OnAcceptMicroflow as stated in the answer above.