title: PDF Upload error System.IO.DirectoryNotFoundException: Could not find a part of the path
body: <p>I have developed an ASP.net C# function to upload PDF to the Database. when I try it in LocalHost, its working perfectly fine. but when I publish it in a server on IIS. it gives me the below error when I click upload:</p>
  
  <pre><code>System.IO.DirectoryNotFoundException: Could not find a part of the
  path + &lt;path of the file&gt;
  </code></pre>
  
  
  
  <pre><code>string filePath = Path.GetFullPath(FileUpload1.PostedFile.FileName);
  string filename = Path.GetFileName(filePath);
  
  FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
  BinaryReader br = new BinaryReader(fs);
  Byte[] bytes = br.ReadBytes((Int32)fs.Length);
  br.Close();
  fs.Close();
  </code></pre>
  
  <p>Is there anything I should change in order to be able to upload?</p>