I am new to ASP.NET 3.5 MVC, I want to upload file using AJAX form.
When I am using html form then I am able to upload files but my requirement is that I am using user control for edit profile, I am using tabs for the same where in we are having multiple tabs for edit profile, change password, etc.
While using AJAX form having enctype = "multipart/form-data" then following statement did not get the files
foreach (string filename in Request.Files)
Please help me find the solution
Thanks in advance
Warm Regards:
Sitanshu
Please "Mark as Answer" if my post sort your problem
Ajax.BeginForm does not allow to upload files and it is not the fault of Ajax.BeginForm.Infact ajax does not allow multipart/form-data enctype. plz see this
http://forums.asp.net/t/1445179.aspx for more help. Hope this post help .
Share if u know something and ask if u don't. Mark as Answer if it is helpful.
Marked as answer by sbakshi on Jul 24, 2009 01:23 PM
Thanks for the support, that post really helps me solving the problem, from there I got the link to following url: http://www.webtoolkit.info/ajax-file-upload.html which helps me solve the problem.
I got the idea from there and solve the problem.
Many Thanks
Warm Regards:
Sitanshu
Please "Mark as Answer" if my post sort your problem
sbakshi
Participant
1147 Points
222 Posts
File upload using AJAX.BeginForm
Jul 24, 2009 07:49 AM|LINK
Hi Everyone,
I am new to ASP.NET 3.5 MVC, I want to upload file using AJAX form.
When I am using html form then I am able to upload files but my requirement is that I am using user control for edit profile, I am using tabs for the same where in we are having multiple tabs for edit profile, change password, etc.
While using AJAX form having enctype = "multipart/form-data" then following statement did not get the files foreach (string filename in Request.Files)
Please help me find the solution
Thanks in advance
Sitanshu
Please "Mark as Answer" if my post sort your problem
Blog: http://sharp-architecture.blogspot.com/
ZafarYousafi
Contributor
2542 Points
401 Posts
Re: File upload using AJAX.BeginForm
Jul 24, 2009 09:51 AM|LINK
Ajax.BeginForm does not allow to upload files and it is not the fault of Ajax.BeginForm.Infact ajax does not allow multipart/form-data enctype. plz see this http://forums.asp.net/t/1445179.aspx for more help. Hope this post help .
sbakshi
Participant
1147 Points
222 Posts
Re: File upload using AJAX.BeginForm
Jul 24, 2009 01:17 PM|LINK
Hi Zafar,
Thanks for the support, that post really helps me solving the problem, from there I got the link to following url: http://www.webtoolkit.info/ajax-file-upload.html which helps me solve the problem.
I got the idea from there and solve the problem.
Many Thanks
Sitanshu
Please "Mark as Answer" if my post sort your problem
Blog: http://sharp-architecture.blogspot.com/
itsut
Member
4 Points
2 Posts
Re: File upload using AJAX.BeginForm
Sep 26, 2009 05:48 PM|LINK
Were you able to solve this problem with AJAX.BeginForm?
sbakshi
Participant
1147 Points
222 Posts
Re: File upload using AJAX.BeginForm
Nov 10, 2009 04:23 AM|LINK
Yes I am able to solve the problem
Sitanshu
Please "Mark as Answer" if my post sort your problem
Blog: http://sharp-architecture.blogspot.com/
khaavren
Member
2 Points
1 Post
Re: File upload using AJAX.BeginForm
Aug 05, 2010 12:49 AM|LINK
Why take the time to respond with "yes I got it working" when you don't post your solution?
jozeASPASP
Member
10 Points
9 Posts
Re: File upload using AJAX.BeginForm
Sep 17, 2010 10:56 AM|LINK
why bother lol? I wish there was a like button as in facebook xD people are nice sometimes and like to share info
JashuaNet
Member
86 Points
41 Posts
Re: File upload using AJAX.BeginForm
Oct 25, 2010 01:18 PM|LINK
Here a sample project, that shows ASP.NET ajax upload usage ( without runat=server or WebForms)
ASP.NET ajax upload
Flavius Demi...
Member
2 Points
1 Post
Re: File upload using AJAX.BeginForm
Nov 23, 2012 12:25 AM|LINK
It is possible, the answer is here:
link
I did it myself and it's guaranteed it works.