Reputation: 544
I am using WFFM 8.1 rev. 160304 Update-2. I have to do below Customisation in File Upload validation Control :
For top two requirements I am referring the below URLs but it's not working .
https://jonathanrobbins.co.uk/2015/10/06/sitecore-marketplace-module-secure-file-upload/
Upvotes: 0
Views: 352
Reputation: 2635
I have an upload field working with the some of your requirements (file size and extension). It should be extendable to include your others as well.
What we did was:
FileUploadField
public override HttpPostedFileBase Value { get; set; }
, e.g. [LimitAllowedExtensions][LimitFileSize]
public sealed class LimitAllowedExtensionsAttribute : DynamicValidationBase
protected override ValidationResult ValidateFieldValue(IViewModel model, object value, ValidationContext validationContext)
with the validation you wantRegister your custom field in Sitecore and you're good to go. I'm not sure how to do the upload to a physical folder, you might want to look at the other functions in the FileUploadField (and maybe use a decompiler to check out the original code).
Wrote a blog post explaining this.
Upvotes: 2