ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Rename and save Image Error: The SaveAs method is configured to require a rooted path<p>Hi <a class="username" rel="sureshMGR"> sureshMGR</a>,</p> <p>You have not assigned folder name where you want to save your file. Refer below code change your code.</p> <p><span style="text-decoration: underline;"><strong>Code</strong></span></p> <p><strong>Handler.ashx</strong></p> <pre class="brush: csharp">&lt;%@ WebHandler Language=&#34;C#&#34; Class=&#34;Handler&#34; %&gt; using System; using System.Web; public class Handler : IHttpHandler { public string _html = string.Empty; public void ProcessRequest(HttpContext context) { try { if (context.Request.Files.Count &gt; 0) { HttpFileCollection files = context.Request.Files; var newfilename = context.Request.Form.ToString().Split(&#39;=&#39;)[1]; // new filename is 1111 HttpPostedFile file = files[0]; string oldfilename = file.FileName; //oldfilename is 1323 string fname = context.Server.MapPath(&#34;~/empimages/&#34; + oldfilename); file.SaveAs(&#34;~/empimages/&#34; + newfilename); // showing error as The SaveAs method is configured to require a rooted path, and the path &#39;1323&#39; is not rooted. } context.Response.ContentType = &#34;text/plain&#34;; context.Response.Write(&#34;ok&#34;); } catch (Exception ex) { _html = &#34;ERROR~&#34;; } } public bool IsReusable { get { return false; } } }</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/954096/Rename-and-save-Image-Error-The-SaveAs-method-is-configured-to-require-a-rooted-path/https://www.aspforums.net:443/Threads/954096/Rename-and-save-Image-Error-The-SaveAs-method-is-configured-to-require-a-rooted-path/Tue, 13 Aug 2019 06:36:04 GMT