public IHttpActionResult Save(MultiFileModel model)
        {
            // var fileName = DateTime.Now.ToString("yyyyMMdd.hhmmss.") + type + ".json";
            // File.Create(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/files/" + fileName + ".tmp"));
            try
            {
                var serializer = new JavaScriptSerializer()
                {
                    MaxJsonLength = Int32.MaxValue
                };

                File.WriteAllText(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/files/" + model.FileName), serializer.Serialize(model.Files), System.Text.Encoding.UTF8);
                return(Ok(new { success = true }));
            }
            catch (Exception ex)
            {
                return(Ok(new { success = false, msg = ex.Message }));
            }
        }
        public IHttpActionResult SaveImg(MultiFileModel model)
        {
            try
            {
                // var fileName = DateTime.Now.ToString("yyyyMMdd.hhmmss.") + type + ".json";
                // File.Create(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/files/" + fileName + ".tmp"));
                var dirName = System.Web.Hosting.HostingEnvironment.MapPath("~/Content/files/" + model.FileName);
                Directory.CreateDirectory(dirName);
                Directory.CreateDirectory(Path.Combine(dirName, "thumb"));
                int thumbWidth = 120;

                foreach (var fileB64 in model.Files)
                {
                    if (fileB64.base64 == null)
                    {
                        continue;
                    }
                    var    fileName  = Path.Combine(dirName, fileB64.name);
                    var    thumbName = Path.Combine(dirName, "thumb", fileB64.name);
                    byte[] fileBytes = Convert.FromBase64String(fileB64.base64String);
                    using (MemoryStream uplfileStream = new MemoryStream(fileBytes, 0, fileBytes.Length))
                    {
                        using (FileStream fs = new FileStream(fileName, FileMode.OpenOrCreate))
                        {
                            uplfileStream.CopyTo(fs);
                            fs.Flush();
                        }

                        Image image = Image.FromStream(uplfileStream);
                        Image thumb = image.GetThumbnailImage(thumbWidth, (int)(((float)image.Height / (float)image.Width) * (float)thumbWidth), () => false, IntPtr.Zero);
                        thumb.Save(thumbName);
                    }
                }
                return(Ok(new { success = true, dir = dirName }));
            }
            catch (Exception ex)
            {
                return(Ok(new { success = false, msg = ex.Message }));
            }
        }