Click here to Skip to main content
15,903,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all
Iam using multiple file upload control to upload multiple files and sending this through mail ... i got code fro here

http://www.aspsnippets.com/Articles/Upload-and-attach-multiple-files-as-attachments-to-email-in-ASPNet.aspx

sending files through mail using this code
List<httppostedfile> files = (List<httppostedfile>)Cache[this.Key];
foreach (HttpPostedFile file in files)
{
mail.Attachments.Add(new Attachment(file.InputStream, Path.GetFileName(file.FileName), file.ContentType));
}
its working well .
.i want to save all attachments to my project folder
List<httppostedfile> files = (List<httppostedfile>)Cache[this.Key]; string lscoll = "";
foreach (HttpPostedFile file in files)
{

fuattachfile.PostedFile.SaveAs(SerPth + Path.GetFileName(file.FileName));
}
im getting files without content in the project folder ...but its going well with images .. how to resolve this??
Posted
Updated 9-Jun-15 20:20pm
v7

file.SaveAs(SerPth + Path.GetFileName(file.FileName));

write like this.
 
Share this answer
 
Comments
amritha444 21-Jun-14 7:19am    
thanks alot Prakash ..Now its working fine :)
Ask there.
You got the code from a different site - so ask for support from the person who wrote it, as they will know the code best.
 
Share this answer
 
Comments
amritha444 21-Jun-14 6:01am    
Ok sir i wil do that .. i posted here to get quick response from the peoples who experienced the same problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900