Click here to Skip to main content
15,891,253 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Get HTML for an element in Page_Load method Pin
eggie55-Oct-06 10:32
eggie55-Oct-06 10:32 
QuestionDataGrid paging problem Pin
saravanan055-Oct-06 8:56
saravanan055-Oct-06 8:56 
AnswerRe: DataGrid paging problem Pin
postmaster@programmingknowledge.com5-Oct-06 23:35
postmaster@programmingknowledge.com5-Oct-06 23:35 
QuestionRegister event attribute onload for the Page from UserControl Pin
Roman Muntyanu5-Oct-06 7:39
Roman Muntyanu5-Oct-06 7:39 
AnswerRe: Register event attribute onload for the Page from UserControl Pin
minhpc_bk5-Oct-06 15:55
minhpc_bk5-Oct-06 15:55 
QuestionFilepath works in IE but not Firefox. Pin
Goalie355-Oct-06 4:25
Goalie355-Oct-06 4:25 
AnswerRe: Filepath works in IE but not Firefox. Pin
Chris Buckett5-Oct-06 9:12
Chris Buckett5-Oct-06 9:12 
GeneralRe: Filepath works in IE but not Firefox. Pin
Goalie359-Oct-06 5:32
Goalie359-Oct-06 5:32 
ChrisB,

You mentioned you were interested in knowing the solution to my problem so here it is:

It actually turns out that although IE accepts this filepath as valid, it's not a good approach to take. So as a different approach, the key is to create a new webpage with the content type set to "application/octet-stream"

-I have a link on my initial page that reads "Click to download file".
-Link to a new aspx webform(I named mine "Download.aspx") & place the url to the downloadable file within either the URL or a session object (mine is within a session).
-Add this code to "Downloader.aspx":
-------------------------------------------
using System.IO;

protected void Page_Load(object sender, EventArgs e)
{
String filepath = Convert.ToString(Session["fileUrl"]);
String filename = Path.GetFileName(filepath);
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.Flush();
Response.WriteFile(filepath);
}
------------------------------------------------

That solved my problem.

-Goalie35

GeneralRe: Filepath works in IE but not Firefox. Pin
Chris Buckett9-Oct-06 22:02
Chris Buckett9-Oct-06 22:02 
QuestionUser control creation order? Pin
Chris Buckett5-Oct-06 3:43
Chris Buckett5-Oct-06 3:43 
AnswerRe: User control creation order? Pin
l0kke5-Oct-06 4:51
l0kke5-Oct-06 4:51 
GeneralRe: User control creation order? Pin
Chris Buckett5-Oct-06 4:57
Chris Buckett5-Oct-06 4:57 
QuestionUpload Big File Pin
MHASSANF5-Oct-06 2:22
MHASSANF5-Oct-06 2:22 
AnswerRe: Upload Big File Pin
Keith Barrow5-Oct-06 2:28
professionalKeith Barrow5-Oct-06 2:28 
QuestionRe: Upload Big File Pin
MHASSANF5-Oct-06 2:37
MHASSANF5-Oct-06 2:37 
AnswerRe: Upload Big File Pin
Gavin Jeffrey5-Oct-06 4:53
Gavin Jeffrey5-Oct-06 4:53 
GeneralRe: Upload Big File Pin
MHASSANF5-Oct-06 10:17
MHASSANF5-Oct-06 10:17 
QuestionHit the enterkey in textbox the resultant value will be displayed in other textbox Pin
irkahc5-Oct-06 2:17
irkahc5-Oct-06 2:17 
AnswerRe: Hit the enterkey in textbox the resultant value will be displayed in other textbox Pin
Mike Ellison5-Oct-06 14:36
Mike Ellison5-Oct-06 14:36 
QuestionDynamically creat imagebox and load image Pin
Vipin.d5-Oct-06 1:49
Vipin.d5-Oct-06 1:49 
AnswerRe: Dynamically creat imagebox and load image Pin
l0kke5-Oct-06 4:59
l0kke5-Oct-06 4:59 
Questionhow to find all the web parts in a particular site Pin
indrani225-Oct-06 1:26
indrani225-Oct-06 1:26 
QuestionRequirment need for Ajax Pin
Exelioindia5-Oct-06 0:46
Exelioindia5-Oct-06 0:46 
AnswerRe: Requirment need for Ajax Pin
Sushant Duggal5-Oct-06 1:05
Sushant Duggal5-Oct-06 1:05 
AnswerRe: Requirment need for Ajax Pin
Aashutoshkumar6-Oct-06 0:24
Aashutoshkumar6-Oct-06 0:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.