Getting a file from the client to the server in asp.net mvc
Getting a file from the client to the server in asp.net mvc
What is the best way to get a file from the client to the server in asp.net mvc?
Will hosting allow you to save a file to their server these days or do you have to save the file on their server? Or is cloud storage the only way (of course then how do you process the file without getting it from the clou开发者_如何学编程d).
Also, are there any really good examples of uploading a file, reading it and putting it in the database for asp.net mvc?
Phil Haack has a blog post on how to upload and save a file using MVC. Don't store the file in a database, just use the name.
http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx
Using just a browser the only practical way to upload a file is using the file input type, just as we always have.
As to whether hosting companies allow you to store files on their systems, that's really down to you and the hosting agreement you sign up to. From there questions about cloud, etc, get answered, i.e. do you need to.
精彩评论