Esempio n. 1
0
        public static string GetFullFilePath(LookUps.FolderName folderName, string fileName)
        {
            string filePath;

            filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, LMYFrameWorkMVC.Common.Helpers.Utilites.GetSettingValue(LookUps.SettingsKeys.UploadFolder), folderName.ToString());

            filePath = Path.Combine(filePath, fileName);
            return(filePath);
        }
Esempio n. 2
0
        public static string CreateFullFilePath(LookUps.FolderName folderName, string fileName)
        {
            string filePath;

            filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, LMYFrameWorkMVC.Common.Helpers.Utilites.GetSettingValue(LookUps.SettingsKeys.UploadFolder), folderName.ToString());

            if (!System.IO.Directory.Exists(filePath))
            {
                Directory.CreateDirectory(filePath);
            }

            // if (File.Exists(filePath))
            //every should has unique name "because of that i use new guid"
            fileName = Guid.NewGuid().ToString() + Path.GetExtension(fileName);

            filePath = Path.Combine(filePath, fileName);
            return(filePath);
        }