From d533a8b32411f6b5e93c35aca0deb3199b73f6cc Mon Sep 17 00:00:00 2001 From: Florian Schaal Date: Mon, 8 Feb 2016 16:21:13 +0100 Subject: [PATCH] Really small change to reduce server mapping Changed: string pathToSave = HttpContext.Current.Server.MapPath("~/MediaUploader/") + str_image; To: string pathToSave = dirFullPath + str_image; Since the path is already declared why not use it instead of mapping the path again. --- hn_SimpeFileUploader.ashx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hn_SimpeFileUploader.ashx b/hn_SimpeFileUploader.ashx index c16dfd3..e8ac9cf 100644 --- a/hn_SimpeFileUploader.ashx +++ b/hn_SimpeFileUploader.ashx @@ -30,7 +30,7 @@ public void ProcessRequest(HttpContext context) { fileExtension = Path.GetExtension(fileName); str_image = "MyPHOTO_" + numFiles.ToString() + fileExtension; - string pathToSave = HttpContext.Current.Server.MapPath("~/MediaUploader/") + str_image; + string pathToSave = dirFullPath + str_image; file.SaveAs(pathToSave); } } @@ -45,4 +45,4 @@ public void ProcessRequest(HttpContext context) -} \ No newline at end of file +}