hi Frinny hope u'll notice my new doubt.
how is this downloading option given in asp.net? im using asp.net 1.1 n c# as programming lang and sql server as back end.
i actually tried it worked fine but only for a single file, in case if i give more than i file for download in the same page it gives the first file only for download it isnt considering the second one ....
-
private void Page_Load(object sender, System.EventArgs e)
-
{
-
Response.Clear();
-
string path = Request.QueryString["fname"];
-
System.IO.FileInfo a = new System.IO.FileInfo("c:/IP_Handbook.pdf");
-
Response.AddHeader("Content-Disposition","attachment;filename =" +a.Name);
-
Response.AddHeader("Content-Length",a.Length.ToString());
-
Response.ContentType="application/octate-stream";
-
Response.WriteFile(a.FullName);
-
Response.End();
-
}
in the design page i have used 2 hyperlinks and in the url path i hv given the path of the pdf file (which i hv chosen here) - all these design is in webform1 and the code is in another webform2 - where there is nothing in design sheet.
i want to use this technique for archieving monthly newsletter...please help me.
I've just done something similar with a reporting service I created.
What I ended up doing was saving the the files to a temporary location on the web server, then once these were created I displayed a <div> in the middle of the screen listing hyperlinks to the files that are ready for downloading.
I don't think that your method will allow you to let the user download more than one file at a time because it is writing the content directly to the Response.Write output stream stream instead of temporarily storing the data for download.
I tend to like doing exactly what you are doing because it reduces the need to clean up the resources.
If you're doing a newsletter...why not store a copy of the newsletter on the server and use a similar method to mine?
There's no need to dynamically create a newsletter because they are the same for all users.
-Frinny