title: The system cannot find the file specified in c# (no upload)
body: <p>this morning my application developed in C# ASP.NET has a problem that has never occurred before</p>
  <p>this application stores the filename within the column of a database</p>
  <p>when it comes time to send the attachment via email, the application looks for the file name and attaches it to the message</p>
  <p>the application cannot find the attached files on the physical path of the server even if these files are correctly present and block sending an email with attachment</p>
  <p>the error is</p>
  <blockquote>
  <p>The system cannot find the file specified 'C:\inetpub\wwwroot\public\newfile.pdf'</p>
  </blockquote>
  <p>the file <code>newfile.pdf</code> instead it is located inside the public folder</p>
  <p>how to do resolve this?</p>
  <p>my simplified code below</p>
  <pre><code>List&lt;string&gt; listofattachments = new List&lt;string&gt;();
  
  
  using (OdbcDataReader reader = cmd.ExecuteReader())
  {
      if (reader.HasRows)
      {
          while (reader.Read())
          {
              listofattachments.Add(reader[&quot;attachment&quot;].ToString());
          }
      }
  }
  
  
  foreach (string attachments in listofattachments)
  {
     if (!string.IsNullOrEmpty(attachments))
     {
        mailMessagePlainText.Attachments.Add(new Attachment(@&quot;C:\\inetpub\\wwwroot\\public\\&quot; + attachments.Trim().ToString())); //line of error
     }
  }
  </code></pre>