ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
File Upload - Multiple Input in IE8
Title:
B
I
{code}
?
I have been trying for a day now to get file upload with a model to work in IE. Have you any suggestions? Basically I want a pop up that will post a model of file and description. I have tried to see what you did with prodinner but could could only see you doing one input at a time. Is it possible to do multiple input in IE that you know of?
Save Changes
Cancel
gotstu
asked at 06 Feb 2014
you're most likely gonna need to use a plugin for this: http://stackoverflow.com/a/13497736/112100
at 06 Feb 2014
Omu
Answers
B
I
{code}
?
I just solved this. Works on IE8 which is low as I go. Of course works on other browsers. This is basically what I did. http://www.alfajango.com/blog/ajax-file-uploads-with-the-iframe-method/ I relation to Awesome I have popup with grid showing attachments and a button which opens another popup that has a form in its content. @using (Html.BeginForm(null, null, FormMethod.Post, new { enctype = "multipart/form-data", id="UploadFileForm" })) { @Html.EditorFor(o => o.Description) @Html.LabelFor(o => o.File) @Html.TextBoxFor(o => o.File, new { type = "file" }) @Html.ValidationMessageFor(o => o.File) @Html.HiddenFor(o => o.CPAId) @Html.HiddenFor(o => o.FileName) <br /> <br /> <br /> <button type="button" class="awe-btn" onclick="$('#UploadFileForm').attr('target', 'iFrame').submit()"> <span>Upload</span> </button> } This form contains button that changes the target of the form to post to iframe (this iframe is added to body onchange of choosing a file). Here is Model public class CPAAttachment : Input { [Required] public int CPAId { get; set; } [Required] public string FileName { get; set; } [Required] public string Description { get; set; } [Required] public HttpPostedFileBase File { get; set; } } The controller takes the posted input model and stores the file in db and returns this. return Content("<script>window.parent.uploadComplete(1)</script>"); This function closes the pop up and refreshes the grid behind. So simple!
Save Changes
Cancel
gotstu
answered at 06 Feb 2014
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK