473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

problem with code download file - two window file download

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
Nov 19 '05 #1
2 1150
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

Nov 19 '05 #2
On Thu, 17 Mar 2005 05:43:03 -0800, "srini"
<sr***@discussions.microsoft.com> 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


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: James Kirk | last post by:
The script below allows me to link to a file and as the user clicks to download, the 'File Download' windows appears as normal, and the user can download... The original page is then redirected...
6
by: chon | last post by:
I have an ASP page that is sent a file location as a parameter. It opens this file, loads the ADODB.Stream object and does a binary write to the page forcing the download dialog to appear. This...
5
by: John Morgan | last post by:
I am using the following link to download a file of about 50k <a target= "_blank" href="http://www.bsecs.org.uk/ExecDocs/documentStore/elfridaWord.doc">open file</a> If I save the file to...
4
by: moondaddy | last post by:
Using vb.net I need to download image files to the client browser where they can save to disk. Below is some sample code I'm using. when I run this the File Download window in the browser says: ...
11
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as...
2
by: John | last post by:
Hi, I posted this earlier in microsoft.public.dotnet.framework.aspnet, but didn't get a response, so I thought I'd try here. Basically, I'm having a problem opening / downloading csv files...
5
by: Steve | last post by:
Hi, I currently have a problem passing a variable value from one page to another. Once a form submit button is pressed java pops up a window and displays some information. The problem being is...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
1
by: rohit3291 | last post by:
Friends i need your help on the below issue please help me urgent...... Thanks in advance... I have a web site where i have a button called report. On click of report button some data is being...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.