Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > problem with code download file - two window file download

Reply
Thread Tools

problem with code download file - two window file download

 
 
Sam --
Guest
Posts: n/a
 
      03-17-2005
Hi all
I've a problem
I write code for download a file.
Sometimes when I run the code, the window of "File Download" appears
I push the "open" button and the window of "File Download" appears
again
This happens in this situation
windows 2003 - IE version 6.0.3790.0

note:
If i comment the line
********
Response.AppendHeader("content-disposition", "attachment;
filename=prova.xls")
*******
the problem does not happen but I cannot specify the name of the file



thanks
Sam --



'................................................. ......................
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

With Response
.Clear()
.ClearContent()
.ClearHeaders()

End With

Response.ContentType = "application/vnd.ms-excel"
Response.AppendHeader("content-disposition", "attachment;
filename=prova.xls")
Response.Write("test")
Response.End()
Response.Flush()
End Sub
 
Reply With Quote
 
 
 
 
=?Utf-8?B?c3Jpbmk=?=
Guest
Posts: n/a
 
      03-17-2005
Hi Sam,
I noticed a similar problem some time ago on machines installed with open
office instead of MS office. So if you dont have MS Office installed on your
machine or Excel viewer then check it on another machine.
HTH
srini

"Sam --" wrote:

> Hi all
> I've a problem
> I write code for download a file.
> Sometimes when I run the code, the window of "File Download" appears
> I push the "open" button and the window of "File Download" appears
> again
> This happens in this situation
> windows 2003 - IE version 6.0.3790.0
>
> note:
> If i comment the line
> ********
> Response.AppendHeader("content-disposition", "attachment;
> filename=prova.xls")
> *******
> the problem does not happen but I cannot specify the name of the file
>
>
>
> thanks
> Sam --
>
>
>
> '................................................. ......................
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
> With Response
> .Clear()
> .ClearContent()
> .ClearHeaders()
>
> End With
>
> Response.ContentType = "application/vnd.ms-excel"
> Response.AppendHeader("content-disposition", "attachment;
> filename=prova.xls")
> Response.Write("test")
> Response.End()
> Response.Flush()
> End Sub
>

 
Reply With Quote
 
 
 
 
Sam --
Guest
Posts: n/a
 
      03-17-2005
On Thu, 17 Mar 2005 05:43:03 -0800, "srini"
<(E-Mail Removed)> wrote:

>Hi Sam,
>I noticed a similar problem some time ago on machines installed with open
>office instead of MS office. So if you dont have MS Office installed on your
>machine or Excel viewer then check it on another machine.
>HTH
>srini

I have two machine with windows 2003 - IE version 6.0.3790.0
One has Office 2002
The other machine does not have Office for nothing
The two machines have installed SQL Server 2000 - sp3

Sam --






>"Sam --" wrote:
>
>> Hi all
>> I've a problem
>> I write code for download a file.
>> Sometimes when I run the code, the window of "File Download" appears
>> I push the "open" button and the window of "File Download" appears
>> again
>> This happens in this situation
>> windows 2003 - IE version 6.0.3790.0
>>
>> note:
>> If i comment the line
>> ********
>> Response.AppendHeader("content-disposition", "attachment;
>> filename=prova.xls")
>> *******
>> the problem does not happen but I cannot specify the name of the file
>>
>>
>>
>> thanks
>> Sam --
>>
>>
>>
>> '................................................. ......................
>> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles Button1.Click
>>
>> With Response
>> .Clear()
>> .ClearContent()
>> .ClearHeaders()
>>
>> End With
>>
>> Response.ContentType = "application/vnd.ms-excel"
>> Response.AppendHeader("content-disposition", "attachment;
>> filename=prova.xls")
>> Response.Write("test")
>> Response.End()
>> Response.Flush()
>> End Sub
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tell if child window is open in code behind parent window-web app Paul ASP .Net 0 06-17-2008 10:46 PM
How to compare two SOAP Envelope or two Document or two XML files GenxLogic Java 3 12-06-2006 08:41 PM
two arrays problem (although different from the other two arrays) Kev Jackson Ruby 2 03-29-2006 03:58 PM
window to window communication (window.opener) Andrew Bewley via DotNetMonster.com ASP .Net 0 02-03-2005 12:59 PM



Advertisments