Attachments

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
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,037
Latest member
MozzGuardBugs

Latest Threads

Top