Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 1st, 2005, 04:50 PM
rafaeazhar rafaeazhar is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 7 rafaeazhar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 27 m 30 sec
Reputation Power: 0
Attaching and mailing an image

Firstly, Whenever you want to attach anything with a mail, u press the 'Attach' button and a window shows up in which you can find the file to be attached and give its path. How is that possible in an ASP.NET page ?
Secondly, if the file path is selected in the manner explained above, how can I actually mail the attached image to any email address using VB code? Basically a user selects the image he wants to use while registering on my website and i want that image to somehow come on the server so that i can use it on the ASP webpages.
I am totally blank about these concepts, kindly elaborate in detail. Thank you.

Reply With Quote
  #2  
Old November 2nd, 2005, 05:15 PM
blicci's Avatar
blicci blicci is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Philly
Posts: 351 blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 22 h 8 m 5 sec
Reputation Power: 52
I'll get you started.
Since we are doing this in asp.net all the actions you describe must happen on the server. To attach a file to an email, you must first get that file up to the server somewhere. To do this use the serverside file input control
Code:
<input type=file runat=server id=file1>

you can then copy that file selected up to the server
Code:
Public Sub PostFile
dim path as string
path = server.mappath("the directory on the server you want to copy the file too")
'to retain the  files original name you need to parse it out
dim filename() as string 
filename = split(file1.postedfile.filename ,"\") 'load the full path into an array
'now build the destination for your file
dim Destination as string
Destination = path & "\" & filename(ubound(filename))
'finally save the file to your server
File1.PostedFile.SaveAs(Destination)
End Sub


To email the file you can use the CDONTS object

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Attaching and mailing an image


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT