Attachments

  • Thread starter Thread starter STEPHEN ANDRADE
  • Start date Start date
S

STEPHEN ANDRADE

I am currently designing a webform for sending email. I want to send an
attachment with the email. I am using the html Input File to pick the
location of the file I want to attach.

I find that there is no problem sending an attachment when there are no
spaces in the directory (e.g. c:\images\new.jpg) but if the path specified
has spaces (c:\documents and settings\my documents\new.jpg) then I am
getting http exception I have tried using different character instead of the
spaces

If uploadedfile.Value <> "" Then

Dim substring As String

substring = uploadedfile.Value.ToString 'uplodedfile = htmlinputfile

Dim Attach As MailAttachment = New MailAttachment(substring)

Message.Attachments.Add(Attach)

Response.Write(uploadedfile.Value)

End If

If you have any suggestions I wouuld love to hear them

Thanks in advance
Stephen
 
the htmlinputfile is the location on the client machine, not the server.
you should write the uploaded file to disk, then use that file as an
attachment.

-- bruce (sqkwork.com)
 
Back
Top