ActivEarth.Account.EditProfile.getUploadPath C# (CSharp) 메소드

getUploadPath() 개인적인 메소드

Gets the absolute path to the upload directory for user photos.
private getUploadPath ( int userID, string fileExtension ) : string
userID int The ID of the user.
fileExtension string The extension of the file to retrieve the path for.
리턴 string
        private string getUploadPath(int userID, string fileExtension)
        {
            string imgName = userID + fileExtension;

            string path = imageDirPath("Original");
            string uploadDir = userImageDirPath("Original", userID);
            string uploadPath = uploadDir + imgName;

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            if (!Directory.Exists(uploadDir))
            {
                Directory.CreateDirectory(uploadDir);
            }

            return uploadPath;
        }