TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mari muthu
NA
198
107.3k
Mvc Pass multiple upload file to controller using jquery
Apr 11 2018 5:01 AM
hi,
i am trying to do passing multiple upload file to controller. but i am not getting the Exact answer can you please help me for this.
<
form
name
=
'frmAccount'
id
=
'frmAccount'
>
<
input
type
=
'file'
name
=
'file1'
/>
<
input
type
=
'file'
name
=
'file2'
/>
<
input
type
=
'file'
name
=
'file3'
/>
<
input
type
=
'file'
name
=
'file4'
/>
<
input
type
=
'file'
name
=
'file5'
/>
<
input
type
=
'file'
name
=
'file6'
/>
<
input
type
=
'file'
name
=
'file7'
/>
<
input
type
=
'submit'
name
=
'submit'
/>
</
form
>
public
class
ImageModel
{
public
HttpPostedFileBase file1{
get
;
set
;}
public
HttpPostedFileBase file2{
get
;
set
;}
public
HttpPostedFileBase file3{
get
;
set
;}
public
HttpPostedFileBase file4{
get
;
set
;}
public
HttpPostedFileBase file5{
get
;
set
;}
public
HttpPostedFileBase file6{
get
;
set
;}
public
HttpPostedFileBase file7{
get
;
set
;}
}
var formData =
new
FormData($(
'#frmAccount'
)[0]);
$.ajax({
url:
"@Url.Action("
AddCustomer
", "
Example
")"
,
type:
"POST"
,
data: formData ,
dataType:
'json'
,
contentType:
false
,
processData:
false
,
success: function (data) {
}
},
error: function (xhr, desc, err) {
}
});
[HttpPost]
public
ActionResult AddCustomer(ImageModel model)
{
//i want to get all the files Here.
}
Reply
Answers (
7
)
Create Chart Dynamically in vb.Net
i want to get data of all selected checked box.