Friday, 15 March 2013

FileUpload: ‘The given path’s format is not supported’

I have Solved this , I posting this here in case others have the same Problem.
am getting this Error while Uploading Using Asp.Net FileUpload Control.

While saving the Image into Local Directory.

Instead of taking the Total File Path of Uploaded Image like

 strUploadPath = fileupload1.PostedFile.FileName.ToString()

Replace Code With:

strUploadPath = System.IO.Path.GetFileName(fileupload1.PostedFile.FileName.ToString())

 fileupload1.PostedFile.SaveAs(ConfigurationSettings.AppSettings("UploadDirUrl").ToString() & strUploadPath)


  1. Really a good technical site,keep on writing good stuffs
    dot net training in chennai

  2. Thank you this article has really helped me