Exemple #1
0
        public ActionResult AddThreeModule(string url, HttpPostedFileWrapper file)
        {
            string fileName = DateTime.Now.ToString("yyyyMMddhhssmm");
            var    vpath    = Path.Combine("/img/", fileName + Path.GetExtension(file.FileName));
            string path     = Server.MapPath("~" + vpath);

            file.SaveAs(path);

            var obj = new JObject();

            obj["url"]  = url;
            obj["path"] = vpath;

            api.AddThreeModule(obj);
            return(RedirectToAction("ThreeModule"));
        }