Posted on: 5/7/2012 4:22:26 PM | Views : 241

Hello all,
my question is: i have a binary file URL on server, something like: http:/some.site.org/files/id.
And now i wanna download it using the aspx page, i have a LinkButton control component in this page, and when i click this button, then a normal browser's download dialog hint windows should be popup, which includes "save", "save as", and "cancel". How can i achieve this?
i've tried following: in the code behind (xxx.aspx.cs):
protected void LinkButton1_Click(object sender, EventArgs e) { string downloadURL = "http://some.url"; Response.ContentType = "image/jpeg"; Response.AddHeader("Content-Disposition", string.Format("attachment;filename=auto.jpeg")); Response.TransmitFile(downloadURL); Response.End(); } which means, after i click the linkbutton, the url of binary data should be get from server and client's browser tells the user to save the binary data, then user choose where to save th ...

Go to the complete details ...