
- Forum
- Programming Talk
- Microsoft .NET
- i want to upload bulk of files at a time
i want to upload bulk of files at a time
This is a discussion on i want to upload bulk of files at a time within the Microsoft .NET forums, part of the Programming Talk category; I have to download some files from server through asp.net 1.1 .I have to develop a form in which we ...
-
i want to upload bulk of files at a time
I have to download some files from server through asp.net 1.1 .I have to develop a form in which we can download file from a dir on server to the my own pc .I have this kind of code
"HttpContext.Current.Response.AppendHeader("content-disposition", "attachment;filename=/doc/jak.doc")
'Response.ContentType = "application/vnd.ms-word"
response.writefile("jak.doc")"
this code asks wheather to open,save cancel
i do not want this ,I want direct download and also direct upload 10 to 20 file in one shot
Please help me out
-
Code for uploding 3 file same way u can upload 10
int mailcount;
mailcount=lstMail.Items.Count;
for(int i=0;i{
MailMessage mailMsg=new MailMessage();
mailMsg.From="PrimetravelsAdmin@primetravels.com";
//mailMsg.To="saju@centrumedia.com";
mailMsg.To=lstMail.Items.Text;
mailMsg.Subject=txtmsubject.Text;
mailMsg.Body=txtmessage.Text;
mailMsg.BodyFormat=MailFormat.Html;
string attach1 = null;
string attach2 = null;
string attach3 = null;
string strFileName = null;
if (inptAttachFile.PostedFile!=null)
{
HttpPostedFile attFile = inptAttachFile.PostedFile;
int attachFileLength = attFile.ContentLength;
if (attachFileLength > 0)
{
strFileName = Path.GetFileName(inptAttachFile.PostedFile.FileName);
inptAttachFile.PostedFile.SaveAs(Server.MapPath(strFileName));
MailAttachment attach = new MailAttachment(Server.MapPath(strFileName));
mailMsg.Attachments.Add(attach);
attach1 = strFileName;
}
}
if (inpAttachment2.PostedFile != null)
{
HttpPostedFile attFile = inpAttachment2.PostedFile;
int attachFileLength = attFile.ContentLength;
if (attachFileLength > 0)
{
strFileName = Path.GetFileName(inpAttachment2.PostedFile.FileName);
inpAttachment2.PostedFile.SaveAs(Server.MapPath(strFileName));
MailAttachment attach = new MailAttachment(Server.MapPath(strFileName));
mailMsg.Attachments.Add(attach);
attach2 = strFileName;
}
}
/* Attachment-3 Repeat previous steps */
if (inpAttachment3.PostedFile != null)
{
HttpPostedFile attFile = inpAttachment3.PostedFile;
int attachFileLength = attFile.ContentLength;
if (attachFileLength > 0)
{
strFileName = Path.GetFileName(inpAttachment3.PostedFile.FileName);
inpAttachment3.PostedFile.SaveAs(Server.MapPath(strFileName));
MailAttachment att

Reply With Quote





