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 ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Manage Your Time Wisely | admin | Career Advice | 2 | 05-12-2006 07:03 AM |
| Microsoft .NET : List Files in a Directory | techguru | Microsoft .NET Tutorials and Articles | 0 | 08-29-2005 07:25 AM |
| Combining files | powerstar | Visual Basic Tutorials | 14 | 11-21-2004 06:40 AM |
| what does bulk collecter and Bulk Binding will do | rite2sekhar | Oracle Tutorials | 1 | 10-08-2004 04:59 PM |
| Tips for moving to save money and time | kalareddy | Chit-Chat | 1 | 06-21-2004 04:13 AM |