예제 #1
0
파일: Upload.cs 프로젝트: yarivat/Admin
        public string GetUploadPath(string fileName)
        {
            string uploadPath = fileName;;

            if (string.IsNullOrEmpty(UploadPhysicalPath))
            {
                uploadPath = UploadVirtualPath.Replace("/", "\\");

                if (!UploadVirtualPath.StartsWith(@"~\"))
                {
                    if (!uploadPath.StartsWith(@"\"))
                    {
                        uploadPath = @"\" + uploadPath;
                    }
                    uploadPath = "~" + uploadPath;
                }
                uploadPath = System.Web.HttpContext.Current.Server.MapPath(uploadPath);
            }
            else
            {
                uploadPath = UploadPhysicalPath;
            }

            if (!uploadPath.EndsWith(@"\"))
            {
                uploadPath = uploadPath + @"\";
            }

            return(uploadPath);
        }
예제 #2
0
파일: Upload.cs 프로젝트: yarivat/Admin
 public string GetVirtualPath()
 {
     return(UploadVirtualPath.ToLower().Replace(ApplicationPathToken, System.Web.HttpContext.Current.Request.ApplicationPath));
 }