title: Saving file attachment to folder on search then writing its path to DB?
body: <p>I would like to save the file attachment to a folder on the website.</p>
  
  <p>My code that creates the attachment to email is like this:</p>
  
  <pre><code>' Attachments
  If Not (FileUpload1.FileName = "") Then
      Dim myattachment1 As New Net.Mail.Attachment(FileUpload1.PostedFile.InputStream, FileUpload1.PostedFile.FileName)
      message.Attachments.Add(myattachment1)
  End If
  </code></pre>
  
  <p>I would like to save the attachments to "C:\DotNetNuke5\Portals\6\JobApplicationDocuments" on the server. Then I would like to save the path to the file in a DB column called 'attachment'.</p>
  
  <p>I would like some help, or things I can search with Google as I am new to this. Thanks</p>
  
  <p>Edit: I now have this code:</p>
  
  <pre><code>If Not (FileUpload1.FileName = "") Then
      Dim myattachment1 As New Net.Mail.Attachment(FileUpload1.PostedFile.InputStream, FileUpload1.PostedFile.FileName)
      message.Attachments.Add(myattachment1)
  
      Dim savePath As String = "C:\DotNetNuke5\Portals\6\JobApplicationDocuments\"
      If (FileUpload1.HasFile) Then
          savePath += FileUpload1.FileName
      End If
  
  End If
  </code></pre>
  
  <p>But I can't get it to save in the directory.</p>