コード例 #1
0
		public static void UploadFile(ImageUploader uploadControl, HttpPostedFile file, string originalName, string newName, out string filePath)
		{
            filePath = string.Empty;

			string path = GetUploadRootPath("ImageUploadRootPath");
            string tempPath = Path.Combine(path + @"Temp\", newName);
			AutoCreateUploadPath(path);

			var beforeArgs = new UploadEventArgs(originalName);
            //uploadControl.OnBeforeUploadFile(beforeArgs);
			file.SaveAs(Path.Combine(path + @"Temp\", newName));
			var afterArgs = new UploadEventArgs(newName);
            //uploadControl.OnAfterUploadFile(afterArgs);

            filePath = tempPath;
		}
コード例 #2
0
ファイル: ImageUploadHelper.cs プロジェクト: wooln/AK47Source
        public static void UploadFile(ImageUploader uploadControl, HttpPostedFile file, string originalName, string newName, out string filePath)
        {
            filePath = string.Empty;

            string path     = GetUploadRootPath("ImageUploadRootPath");
            string tempPath = Path.Combine(path + @"Temp\", newName);

            AutoCreateUploadPath(path);

            var beforeArgs = new UploadEventArgs(originalName);

            //uploadControl.OnBeforeUploadFile(beforeArgs);
            file.SaveAs(Path.Combine(path + @"Temp\", newName));
            var afterArgs = new UploadEventArgs(newName);

            //uploadControl.OnAfterUploadFile(afterArgs);

            filePath = tempPath;
        }