Example #1
0
 public static string UploadSKUImage(HttpPostedFile postedFile)
 {
     if (!ResourcesHelper.CheckPostedFile(postedFile, "image"))
     {
         return string.Empty;
     }
     string str = Globals.GetStoragePath() + "/sku/" + ResourcesHelper.GenerateFilename(Path.GetExtension(postedFile.FileName));
     postedFile.SaveAs(HttpContext.Current.Request.MapPath(Globals.ApplicationPath + str));
     return str;
 }
        public static string UploadLogo(HttpPostedFile postedFile)
        {
            if (!ResourcesHelper.CheckPostedFile(postedFile))
            {
                return(string.Empty);
            }
            string str = HiContext.Current.GetStoragePath() + "/" + ResourcesHelper.GenerateFilename(Path.GetExtension(postedFile.FileName));

            postedFile.SaveAs(HiContext.Current.Context.Request.MapPath(Globals.ApplicationPath + str));
            return(str);
        }
        public static string UploadSKUImage(HttpPostedFile postedFile)
        {
            if (!ResourcesHelper.CheckPostedFile(postedFile, "image", null))
            {
                return(string.Empty);
            }
            string text = HiContext.Current.GetStoragePath() + "/sku/" + ResourcesHelper.GenerateFilename(Path.GetExtension(postedFile.FileName));

            postedFile.SaveAs(HiContext.Current.Context.Request.MapPath(text));
            return(text);
        }
Example #4
0
		public static string UploadLogo(HttpPostedFile postedFile)
		{
			string result;
			if (!ResourcesHelper.CheckPostedFile(postedFile))
			{
				result = string.Empty;
			}
			else
			{
				string text = HiContext.Current.GetStoragePath() + ResourcesHelper.GenerateFilename(Path.GetExtension(postedFile.FileName));
				postedFile.SaveAs(HiContext.Current.Context.Request.MapPath(Globals.ApplicationPath + text));
				result = text;
			}
			return result;
		}
Example #5
0
        public static string UploadSKUImage(HttpPostedFile postedFile)
        {
            string empty;

            if (ResourcesHelper.CheckPostedFile(postedFile, "image"))
            {
                string str = string.Concat(Globals.GetStoragePath(), "/sku/", ResourcesHelper.GenerateFilename(Path.GetExtension(postedFile.FileName)));
                Globals.UploadFileAndCheck(postedFile, HttpContext.Current.Request.MapPath(string.Concat(Globals.ApplicationPath, str)));
                empty = str;
            }
            else
            {
                empty = string.Empty;
            }
            return(empty);
        }
Example #6
0
        public static string UploadBrandCategorieImage(HttpPostedFile postedFile)
        {
            string result;

            if (!ResourcesHelper.CheckPostedFile(postedFile, "image"))
            {
                result = string.Empty;
            }
            else
            {
                string text = Globals.GetStoragePath() + "/brand/" + ResourcesHelper.GenerateFilename(Path.GetExtension(postedFile.FileName));
                postedFile.SaveAs(HttpContext.Current.Request.MapPath(Globals.ApplicationPath + text));
                result = text;
            }
            return(result);
        }
Example #7
0
        public static string UploadCategoryIcon(HttpPostedFile postedFile)
        {
            string result;

            if (!ResourcesHelper.CheckPostedFile(postedFile))
            {
                result = string.Empty;
            }
            else
            {
                if (!Directory.Exists(HiContext.Current.Context.Request.MapPath(Globals.ApplicationPath + HiContext.Current.GetStoragePath() + "/category/")))
                {
                    Directory.CreateDirectory(HiContext.Current.Context.Request.MapPath(Globals.ApplicationPath + HiContext.Current.GetStoragePath() + "/category/"));
                }
                string text = HiContext.Current.GetStoragePath() + "/category/" + ResourcesHelper.GenerateFilename(Path.GetExtension(postedFile.FileName));
                postedFile.SaveAs(HiContext.Current.Context.Request.MapPath(Globals.ApplicationPath + text));
                result = text;
            }
            return(result);
        }
Example #8
0
        /// <summary>
        ///限时抢购获取上传地址
        /// </summary>
        /// <param name="postedFile"></param>
        /// <returns></returns>
        public static string UploadActiveCategorieImage(HttpPostedFile postedFile)
        {
            string result;

            if (!ResourcesHelper.CheckPostedFile(postedFile))
            {
                result = string.Empty;
            }
            else
            {
                if (Directory.Exists(System.Web.HttpContext.Current.Server.MapPath(HiContext.Current.GetStoragePath() + "/ActiveCategorie")) == false)
                {
                    Directory.CreateDirectory(System.Web.HttpContext.Current.Server.MapPath(HiContext.Current.GetStoragePath() + "/ActiveCategorie"));
                }
                string text = HiContext.Current.GetStoragePath() + "/ActiveCategorie/" + ResourcesHelper.GenerateFilename(Path.GetExtension(postedFile.FileName));
                postedFile.SaveAs(HiContext.Current.Context.Request.MapPath(Globals.ApplicationPath + text));
                result = text;
            }
            return(result);
        }
        private string UploadSubjectImg(HttpPostedFile postedFile)
        {
            if (!ResourcesHelper.CheckPostedFile(postedFile))
            {
                return(string.Empty);
            }
            string virtualPath = Globals.ApplicationPath + string.Format("/Templates/sites/{0}/{1}/productsubject/{2}", HiContext.Current.User.UserId, themName, ResourcesHelper.GenerateFilename(Path.GetExtension(postedFile.FileName)));

            postedFile.SaveAs(HttpContext.Current.Request.MapPath(virtualPath));
            return(virtualPath);
        }