3

I am looking for a way to restrict MIME Types on files uploaded through a WFFM form. What I am really hoping for is a way to control the allowed MIME Types using the rules engine. Even if the solution doesn't use the rules engine, it may still help and is still welcome.

Update: We are using our own custom File Upload field that inherits from the OOTB one. I would prefer to not have to rewrite or modify this field for this solution to work, but I will if I absolutely must.

I am using Sitecore 8.1u2 and WFFM 8.1.160304 in an MVC solution.

4
  • 1
    Have you taken a look at jonathanrobbins.co.uk/2015/10/06/… ?
    – jammykam
    Commented Nov 29, 2016 at 15:14
  • I have. The only problem with the module is that it requires that I use the included "Secure File Upload" field. We actually have our own custom File Upload field that I would prefer to not rewrite. Commented Nov 29, 2016 at 15:19
  • Here is a nice solution using validation sitecorejunkie.com/2014/04/06/…
    – C Sigmon
    Commented Nov 29, 2016 at 19:10
  • Post it as an answer and give a little summary :) Commented Nov 29, 2016 at 19:10

1 Answer 1

3

I know that you are looking for a way to do it via the Rules Engine. However, you can do it with a custom field validator.

You can restrict the MIME types that are passed to the custom validator through a parameter named MimeTypesNotAllowed, and these are injected into a property of the same name and map them in Sitecore.

Take a look at https://sitecorejunkie.com/2014/04/06/restrict-certain-files-from-being-attached-to-web-forms-for-marketers-forms-in-sitecore/

2
  • Thanks!let me know if you run into issues by opening a NTT quest.
    – C Sigmon
    Commented Dec 30, 2016 at 0:18
  • Does the suggestion above by @CSigmon applicable to Sitecore 8.1 Update 3 and WFFM 8.1 160523 ? I've tried it and it seems not working on my end.
    – Jovit Mayo
    Commented Oct 25, 2017 at 4:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.