Posting a file as a property of a bigger object ASP.NET MVC3 [Solved (Kind Of)]
-
So, i've exausted my sources for search without any success. I currently have a Web Application that works as a quiz engine (i hope that's the correct translation) in where the administrator can enter Questions and options for answers, including predefined ones (that generate a list of radio buttons or checkboxes), calculated ones (no problem here) and free-text ones. now, the need arraived for a medical quiz that has one question that requires the user to include a file in the answer. currently, when the page that displays the quiz form is posted, the controller receives the following structure: Form -form fields - question collection - Question -question fields //i neeed the attachment to go here, on the question object - options collection there's any way i can get this? as the structure isn't constant (as in i don't even know what types of options will be sent back, their quantities or even if i need a attachment) I can't receive a
IEnumerable<HttpPostedFileBase>
on the controller, so i don't see any options here.... EDIT: acidentally posted the question while i was writing it, sorry.I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
-
So, i've exausted my sources for search without any success. I currently have a Web Application that works as a quiz engine (i hope that's the correct translation) in where the administrator can enter Questions and options for answers, including predefined ones (that generate a list of radio buttons or checkboxes), calculated ones (no problem here) and free-text ones. now, the need arraived for a medical quiz that has one question that requires the user to include a file in the answer. currently, when the page that displays the quiz form is posted, the controller receives the following structure: Form -form fields - question collection - Question -question fields //i neeed the attachment to go here, on the question object - options collection there's any way i can get this? as the structure isn't constant (as in i don't even know what types of options will be sent back, their quantities or even if i need a attachment) I can't receive a
IEnumerable<HttpPostedFileBase>
on the controller, so i don't see any options here.... EDIT: acidentally posted the question while i was writing it, sorry.I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
I just found that the reason my files aren't being posted is that i was using JQuery Ajax, that formated the response with the wrong content-type. as of my search, there's no way to do this by ajax.
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)