示例#1
0
 public ActionResult Download(string src, string contentType)
 {
     if (string.IsNullOrEmpty(src))
     {
         return(new EmptyResult());
     }
     src = Base64Helper.DecodingString(src);
     if (string.IsNullOrEmpty(contentType))
     {
         string text = FileHelper.GetContentType(Path.GetExtension(src));
         if (text.StartsWith("."))
         {
             text = text.Replace(".", "");
         }
         contentType = FileHelper.GetContentType(text);
     }
     return(File(Server.MapPath("~/" + src), contentType));
 }