Exemplo n.º 1
0
        public string FileUploadCustom(long SiteID, string CustomFolder)
        {
            if (Request.Files == null || Request.Files.Count == 0)
            {
                return(null);
            }
            string base64 = "", base64_Resize = "";

            if (!string.IsNullOrEmpty(Request.Form["Base64"]))
            {
                base64 = Request.Form["Base64"];
            }
            if (!string.IsNullOrEmpty(Request.Form["Base64_Resize"]))
            {
                base64_Resize = Request.Form["Base64_Resize"];
            }
            HttpPostedFileBase file = Request.Files[0];

            if (file.ContentLength == 0)
            {
                return(null);
            }

            return(JsonConvert.SerializeObject(new { Name = UpdFileInfo.SaveFilesBySiteID(file, SiteID, CustomFolder, base64, base64_Resize), FileSize = file.ContentLength.ToString() }));
        }