示例#1
0
        public ActionResult Upload(int id, HttpPostedFileBase fil)
        {
            if (fil != null)
            {
                Uploader u    = new Uploader();
                string   path = Request.PhysicalApplicationPath + "Content/Images/";
                string   file = u.UploadImage(fil, path, 300, true);

                BilledFac bf = new BilledFac();
                Billede   b  = new Billede();
                b.Filnavn = Path.GetFileName(file);
                b.PostID  = id;
                bf.Insert(b);
            }

            return(View("Index", postFac.GetIndexData()));
        }
示例#2
0
        public ActionResult Upload(int id, HttpPostedFileBase fil)
        {
            if (fil != null)
            {
                Uploader u = new Uploader();
                string path = Request.PhysicalApplicationPath + "Content/Images/";
                string file = u.UploadImage(fil, path, 300, true);

                BilledFac bf = new BilledFac();
                Billede b = new Billede();
                b.Filnavn = Path.GetFileName(file);
                b.PostID = id;
                bf.Insert(b);

            }

            return View("Index", postFac.GetIndexData());
        }