I’m trying to upload a file from my view to my controller, but the value is always null.
public ActionResult Edit(AttachmentDto dto, HttpPostedFileBase UploadedFile)
<form action="@Url.Action("Edit")" method="post" enctype="multipart/form-data">
<input type="file" name="UploadedFile" id="File" />
There are few other inputs being passed into the controller that the dto is receiving, however the UploadedFile is always null? Am I missing something here?
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Sending multipart/formdata with jQuery.ajax
Just added the FormData object and presto.
Thanks for all of your help!