Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Attachments

Reply
Thread Tools

Attachments

 
 
STEPHEN ANDRADE
Guest
Posts: n/a
 
      09-21-2007
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




 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      09-21-2007
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)

STEPHEN ANDRADE wrote:
> 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
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Differentiating file attachments from inline attachments in Exchange Peter Green Python 0 11-05-2009 04:13 PM
mail.Attachments (Multiple Attachments) from Querystring codewarrior ASP .Net 0 05-04-2009 07:19 PM
attachments unable to read attachments from email bub.mk Computer Support 1 09-29-2004 02:29 AM
Thunderbird 0.5 doesn't forward attachments + little issue with news carreg3|j'aime pas le spam| Firefox 5 04-04-2004 12:59 PM
Message Filter - for attachments Roy E Firefox 1 01-11-2004 03:09 AM



Advertisments