Esempio n. 1
0
        public FileResult Download(int id)
        {
            var book        = BookAPI.GetBook(id);
            var filePath    = Server.MapPath("~/Files/" + book.RealFileName);
            var contentType = MimeMapping.GetMimeMapping(book.RealFileName);

            return(File(filePath, contentType, book.FileName));
        }
Esempio n. 2
0
        public ActionResult Delete(int id)
        {
            var b = BookAPI.GetBook(id);

            if (b == null)
            {
                return(HttpNotFound());
            }
            return(View(b));
        }