I am using Sitecore 9 Forms and I am creating file upload control in Forms, for this, I have created FileUpload file type.

public class FileUploadViewModel: InputViewModel<HttpPostedFileBase>

    public override HttpPostedFileBase Value

    protected override void InitItemProperties(Item item)
    protected override void UpdateItemFields(Item item)


also created FileUpload.cshtml

@model Sitecore.Foundation.Forms.Custom.Fields.FileUploadViewModel 
<input type="file" value="@Model.Value" />

and created one submit action, but I am getting null in Value field. Please provide me some guidance.

Updated jquery.unobtrusive-ajax.js

enter image description here enter image description here

1 Answer 1


The reason your file is not coming through is because the form is sent over ajax and is not using the enctype="multipart/form-data".

This is caused by the script

<script src="/sitecore%20modules/Web/ExperienceForms/scripts/jquery.unobtrusive-ajax.min.js"></script>

loaded via @Html.RenderFormScripts()

More info on this script can be found here:


There are 2 options:

  • use an asynchronous upload via ajax
  • or modify the jquery.unobtrusive-ajax.min.js script.

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.