Answered by:
Upload file using MVC API

Question
-
User70678067 posted
Dear all,
I faces a problem when try to upload file by API post method. In the debug mode it work fines but when I publish the solution to my local IIS it don't work. The front-end is implemented using HTML5, CSS3, JQuery so it is not possible to execute upload code from here, from the form I call the POST API.
Regards,,,
Wednesday, December 3, 2014 1:15 AM
Answers
-
User-434868552 posted
@elmozamil welcome to forums.asp.net
Whenever i need to upload files in ASP.NET MVC, moderator Mike's instructive article is the first place i start ... you'll find it here:
"ASP.NET MVC Uploading and Downloading Files" http://www.mikesdotnetting.com/article/125/asp-net-mvc-uploading-and-downloading-files
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 3, 2014 5:16 AM
All replies
-
User-9639071 posted
What's your file size, May be its problem with httpruntime you need to configure httpruntime in web.config.
http://www.codeproject.com/Articles/10842/Setting-up-Web-config-to-allow-uploading-of-large
Wednesday, December 3, 2014 1:36 AM -
User70678067 posted
Virender,
it is very small size it is less than 50KB, I think the problem is related to the API. Is it possible for the API to read the local path of the server.
Wednesday, December 3, 2014 1:42 AM -
User-434868552 posted
@elmozamil welcome to forums.asp.net
Whenever i need to upload files in ASP.NET MVC, moderator Mike's instructive article is the first place i start ... you'll find it here:
"ASP.NET MVC Uploading and Downloading Files" http://www.mikesdotnetting.com/article/125/asp-net-mvc-uploading-and-downloading-files
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 3, 2014 5:16 AM -
User-1910946339 posted
Show your code.
"It don't work" - Can you provide a little more detail?
Wednesday, December 3, 2014 6:12 PM -
User-1151753377 posted
Hi elmozamil,
Welcome to the ASP.NET forum.
In the debug mode it work fines but when I publish the solution to my local IIS it don't work.Based on my understanding, I think maybe it is because of the publish IIS.
You could check the article and confirm that you have not missing anything when publish your solution.
http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-to-iis
Best Regards,
Summer
Wednesday, December 3, 2014 8:44 PM