Click here to Skip to main content
15,886,137 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAdd a Blank Row to Gridview? Pin
BORN...again!12-Feb-07 13:28
BORN...again!12-Feb-07 13:28 
AnswerRe: Add a Blank Row to Gridview? Pin
enjoycrack12-Feb-07 15:25
enjoycrack12-Feb-07 15:25 
QuestionNavigateUrl='<%=CodeBehindFunction %>' does not work Pin
-Dr_X-12-Feb-07 12:02
-Dr_X-12-Feb-07 12:02 
AnswerRe: NavigateUrl='<%=CodeBehindFunction %>' does not work Pin
andyharman14-Feb-07 8:20
professionalandyharman14-Feb-07 8:20 
Questioni need a code for user login time Pin
suresh_kumar_s12-Feb-07 9:16
suresh_kumar_s12-Feb-07 9:16 
AnswerRe: i need a code for user login time Pin
Rahithi12-Feb-07 10:31
Rahithi12-Feb-07 10:31 
AnswerRe: i need a code for user login time Pin
enjoycrack12-Feb-07 15:27
enjoycrack12-Feb-07 15:27 
QuestionDownloading file not working Pin
Program.X12-Feb-07 9:05
Program.X12-Feb-07 9:05 
Hi,

Got a really annoying problem with downloading a file froma web site.

My code is pretty straight forward:

Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + resource.Filename.Replace(" ","_"));
Response.AddHeader("Content-Length", resource.FileSizeBytes.ToString());
Response.ContentType = resource.MIMEType; // "application/octet-stream";
Response.WriteFile(fileToDownload);
//Response.Flush();
//Response.Close();
Response.End();

(You'll notice indications of desperation - randomly commenting code out) I have tried with the actual MIMEType and the application/octet-stream type - same result.

The download fails, and actually downloads the first x bytes of the web page itself, as the following Fiddler trace reveals:


Many thanks for any help you can give.

Nathan

--------------------------------------------------------------------


HTTP/1.1 200 OK
Date: Mon, 12 Feb 2007 19:47:33 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Content-Disposition: attachment; filename=Blue-LogoOnly.gif
Content-Length: 5329
Cache-Control: private
Content-Type: application/octet-stream; charset=utf-8






<title>
Work Connexions | Your Files











AnswerRe: Downloading file not working Pin
Jon Sagara12-Feb-07 10:21
Jon Sagara12-Feb-07 10:21 
QuestionInstantiation Pin
Civic0612-Feb-07 8:19
Civic0612-Feb-07 8:19 
QuestionWhat does "Clean Solution" do? Pin
robert11012-Feb-07 6:05
robert11012-Feb-07 6:05 
AnswerRe: What does "Clean Solution" do? Pin
Ed.Poore12-Feb-07 8:42
Ed.Poore12-Feb-07 8:42 
QuestionMaximum Attachment Size Pin
happyheartcs12-Feb-07 5:39
happyheartcs12-Feb-07 5:39 
AnswerRe: Maximum Attachment Size Pin
robert11012-Feb-07 6:17
robert11012-Feb-07 6:17 
GeneralRe: Maximum Attachment Size Pin
happyheartcs12-Feb-07 8:27
happyheartcs12-Feb-07 8:27 
GeneralRe: Maximum Attachment Size Pin
robert11012-Feb-07 8:46
robert11012-Feb-07 8:46 
GeneralRe: Maximum Attachment Size Pin
happyheartcs12-Feb-07 22:30
happyheartcs12-Feb-07 22:30 
GeneralRe: Maximum Attachment Size Pin
robert11013-Feb-07 2:54
robert11013-Feb-07 2:54 
GeneralRe: Maximum Attachment Size Pin
happyheartcs13-Feb-07 2:58
happyheartcs13-Feb-07 2:58 
GeneralRe: Maximum Attachment Size Pin
robert11013-Feb-07 3:00
robert11013-Feb-07 3:00 
QuestionWeb services Pin
LCI12-Feb-07 3:56
LCI12-Feb-07 3:56 
AnswerRe: Web services Pin
ednrgc12-Feb-07 5:07
ednrgc12-Feb-07 5:07 
QuestionHow to enable SSL of the PasswordRecovery Control, VS2005 Pin
sync_austin12-Feb-07 3:54
sync_austin12-Feb-07 3:54 
Questionpage load Pin
Gavaskar A12-Feb-07 2:52
Gavaskar A12-Feb-07 2:52 
AnswerRe: page load Pin
Paddy Boyd12-Feb-07 3:12
Paddy Boyd12-Feb-07 3:12 

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.