<! DOCTYPE html>Background program with Webconfig configuration:<system.web>
public class homecontroller:controller{[HttpPost] public ActionResult uploadfile () {HttpPostedFileBase PostedFile = request.files["Uploadfilename"]; Upload filename must be consistent if (postedFile! = null) {string filePath = Path.Combine (AppDomain.CurrentDomain.Base Directory, String. Format ("{0}{1}", DateTime.Now.ToString ("Yyyymmddhhmmsss"), Path.getextension (Postedfile.filename))); using (Stream StreamReader = Postedfile.inputstream) {byte[] buffer = new byte[1024]; using (FileStream streamWriter = new FileStream (FilePath, FileMode.Create, FileAccess.Write)) { int read = streamreader.read (buffer, 0, buffer. Length); while (Read > 0) {streamwriter.write (buffer, 0, buffer. Length); Read = streamreader.read (buffer, 0, buffer. Length); } streamwriter.flush (); StreamWriter.Close (); Streamwriter.dispose (); Streamreader.flush (); Streamreader.close (); Streamreader.dispose (); Return Content ("1"); }}} return Content ("0"); }}
Jquery.uploadify Upload file configuration details (ASP. NET MVC)