I would like to save the file attachment to a folder on the website.
My code that creates the attachment to email is like this:
' 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
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’.
I would like some help, or things I can search with Google as I am new to this. Thanks
Edit: I now have this 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
But I can’t get it to save in the directory.
Save uploaded file, using this code: