473,792 Members | 2,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Downloading files cause IE to lock up in ASPX page

I have the most peculiar problem with an ASP.NET page which we use for
downloading a file.

When the user clicks on a link, the link points to an ASPX page which
downloads the file selected.

The code works fine except after the user saves the file, the links on the
left side of the
frameset do not work. IE locks up.

If the user clicks the refresh button after they download, then everything
works properly again.
Or if the user selects 'OPEN' instead of 'SAVE' on the download dialog box
then the problem doesn't occur.

If I comment out the following line then the problem doesn't occur, however
the attachment name doesn't
appear in the download dialog box either.

Response.AddHea der("Content-Disposition", "attachment ; filename=" +
filename);

There is something about the attachment name that is causing this problem.

The reason we do this in an aspx page instead of in a script is because we
want to do a server side
database update to record the user who is about to download the file (that
code is not shown below).

private void Page_Load(objec t sender, System.EventArg s e)
{
FileInfo fi = new FileInfo("C:\\t est.aspx");
string filename = fi.Name;
Response.Clear( );
Response.ClearH eaders();
Response.ClearC ontent();
// "\"" + filename + "\"\""
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
filename);
Response.Append Header("Content-Length", fi.Length.ToStr ing());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(filepath);
Response.End();
Response.Flush( );
}
Nov 17 '05 #1
6 3018
by using a register script similar to this in your code then you can
actually use a script from your server.

this.RegisterSt artupScript("po pupDialog", "<script language='javas cript'>
showAlertDialog (); </script>");

simply place it after the code that you need to fire first.
Karl

"Tony K" <to**@tksoftwar einc.com> wrote in message
news:uS******** ******@TK2MSFTN GP10.phx.gbl...
I have the most peculiar problem with an ASP.NET page which we use for
downloading a file.

When the user clicks on a link, the link points to an ASPX page which
downloads the file selected.

The code works fine except after the user saves the file, the links on the
left side of the
frameset do not work. IE locks up.

If the user clicks the refresh button after they download, then everything
works properly again.
Or if the user selects 'OPEN' instead of 'SAVE' on the download dialog box
then the problem doesn't occur.

If I comment out the following line then the problem doesn't occur, however the attachment name doesn't
appear in the download dialog box either.

Response.AddHea der("Content-Disposition", "attachment ; filename=" +
filename);

There is something about the attachment name that is causing this problem.

The reason we do this in an aspx page instead of in a script is because we
want to do a server side
database update to record the user who is about to download the file (that
code is not shown below).

private void Page_Load(objec t sender, System.EventArg s e)
{
FileInfo fi = new FileInfo("C:\\t est.aspx");
string filename = fi.Name;
Response.Clear( );
Response.ClearH eaders();
Response.ClearC ontent();
// "\"" + filename + "\"\""
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
filename);
Response.Append Header("Content-Length", fi.Length.ToStr ing());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(filepath);
Response.End();
Response.Flush( );
}

Nov 17 '05 #2
I can't say I totally understand how registering a script would help in this
situation since I have server side database updates to do, to record history
of downloads, etc.

Maybe if you could expand on your example a little more so I would know
where the database updates would go and how to execute the script on the
server side that would help. If registering the script is an IE only
solution then we can't use it since we are trying to support Netscape 6.0
also.

I'd also like to know if this is a known bug in ASP.NET or a bug in IE.
Netscape doesn't have this problem.

Here is all the code if that helps.

private void Page_Load(objec t sender, System.EventArg s e)
{
UploadedFiles UPFiles = new UploadedFiles() ;
string filepath = Page.Request.Pa rams["file"];
if (!(filepath == null))
{
HPSession HPSess = new HPSession();
string UserID = HPSess.getUserI DbySessionID(Se ssion.SessionID );
UPFiles.Uploade dFilesHistoryAd dUpdate("",
Page.Request.Pa rams["UploadedFileID "], UserID);
FileInfo fi = new FileInfo(filepa th);
string filename = fi.Name;
Response.Clear( );
Response.ClearH eaders();
Response.ClearC ontent();
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
filename);
Response.Append Header("Content-Length", fi.Length.ToStr ing());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(filepath);
Response.End();
Response.Flush( );
}
}


"karl" <ka******@hotma il.com> wrote in message
news:Ow******** ******@TK2MSFTN GP12.phx.gbl...
by using a register script similar to this in your code then you can
actually use a script from your server.

this.RegisterSt artupScript("po pupDialog", "<script language='javas cript'>
showAlertDialog (); </script>");

simply place it after the code that you need to fire first.
Karl

"Tony K" <to**@tksoftwar einc.com> wrote in message
news:uS******** ******@TK2MSFTN GP10.phx.gbl...
I have the most peculiar problem with an ASP.NET page which we use for
downloading a file.

When the user clicks on a link, the link points to an ASPX page which
downloads the file selected.

The code works fine except after the user saves the file, the links on the left side of the
frameset do not work. IE locks up.

If the user clicks the refresh button after they download, then everything works properly again.
Or if the user selects 'OPEN' instead of 'SAVE' on the download dialog box then the problem doesn't occur.

If I comment out the following line then the problem doesn't occur,

however
the attachment name doesn't
appear in the download dialog box either.

Response.AddHea der("Content-Disposition", "attachment ; filename=" +
filename);

There is something about the attachment name that is causing this problem.
The reason we do this in an aspx page instead of in a script is because we want to do a server side
database update to record the user who is about to download the file (that code is not shown below).

private void Page_Load(objec t sender, System.EventArg s e)
{
FileInfo fi = new FileInfo("C:\\t est.aspx");
string filename = fi.Name;
Response.Clear( );
Response.ClearH eaders();
Response.ClearC ontent();
// "\"" + filename + "\"\""
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
filename);
Response.Append Header("Content-Length", fi.Length.ToStr ing());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(filepath);
Response.End();
Response.Flush( );
}


Nov 17 '05 #3
Hi Tony,

Please take a look at the following URL:

http://www.eggheadcafe.com/articles/20011006.asp

If I have misunderstood your concern, please let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
<MCSD>
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #4
I tried executing the code from the link you provided. The code never gets
executed even when I click the "get PDF" button. I'm glad to know that
there may be problems with downloading PDF files, and that there is a fix
for it, but this is not the problem I am experiencing. The files download
just fine (they are text files).

However, after the user successfully downloads the files the hyperlinks in
the frameset do not work until the user clicks the refresh button.
"Jacob Yang [MSFT]" <ji***@online.m icrosoft.com> wrote in message
news:ft******** ******@cpmsftng xa06.phx.gbl...
Hi Tony,

Please take a look at the following URL:

http://www.eggheadcafe.com/articles/20011006.asp

If I have misunderstood your concern, please let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
<MCSD>
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #5
Okay, I finally got the server-side script to work. However, the problem
with IE breaking still remains.

This was a fun exercise. I now know how to execute code from a server side
script. The key was making sure not to reference the "code behind" in the
language statement.

In other words, do this:
<%@ Page Language="C#" %>

NOT this:

<%@ Page language="c#" Codebehind="Fil eDownload.aspx. cs"
AutoEventWireup ="false" Inherits="HIPAA Web.Upload.File Download" %>

So, now that this exercise has been completed. We need to get back to the
real problem. As stated in my first posting, this problem only occurs in IE
not Netscape. After downloading and SAVING the downloaded file, IE will not
load a page when you click on a hyperlink in the left side of a frameset.

Send me a note and I will give you a private link to our test web servers
where you can see the problem for yourself.

Thanks,

Tony Kurzendoerfer


"Jacob Yang [MSFT]" <ji***@online.m icrosoft.com> wrote in message
news:ft******** ******@cpmsftng xa06.phx.gbl...
Hi Tony,

Please take a look at the following URL:

http://www.eggheadcafe.com/articles/20011006.asp

If I have misunderstood your concern, please let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
<MCSD>
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #6
Hi Tony,

I am very glad to know that the server-side script works now. Thank you for
sharing the information.

For the original question, please send the following to my email box
ya******@hotmai l.com :

1. The private link to show me the problem step by step

2. The related server side code for the downloading

I certainly appreciate your time.

Best regards,

Jacob Yang
Microsoft Online Partner Support
<MCSD>
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #7

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

Similar topics

5
4914
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 hard disk there is no problem/ if, in response to the menu which appears before downloading, I opt to open the doc file immediately then I get a problem.
7
1347
by: Wardeaux | last post by:
Hey all, I'm hitting a wall... We have many daily reports generated on another server, need to present list of available files and allow user to download desired files from aspx page... any suggestions on how to do this? The other server is running Win2K3 with SQL but no IIS... tried mapping drives and setting up shortcuts, nothing allows permissions from IIS_Guest account... even a "Can't Get there from here..." would be appreciated at...
2
6064
by: Tom Wells | last post by:
I have a little file upload page that I have been able to use to successfully upload files to the C: drive of LocalHost (my machine). I need to be able to upload to a network drive from the intranet server. On the line: dirs = Directory.GetDirectories(currentDir) I get "Access to the path "\\les-net\les\Special Projects\ATSPDF" is denied." How do I get the GetDirectories command to user my user ID and password when it tries to hit the...
1
2083
by: just.starting | last post by:
Hi, My dot net client downloads files and checks for any new files time to time. The server is apache2.0.53 server. So what happens is that my file download thing works fine if I dont try to call any page from the server while downloading. If I try to call a single page while downloading a file then the page request goes time out and the server then closes the existing download stream and the client doestn't throw any exception. So many a...
3
2792
by: just.starting | last post by:
Hi, My dot net client downloads files and checks for any new files time to time. The server is apache2.0.53 server. So what happens is that my file download thing works fine if I dont try to call any page from the server while downloading. If I try to call a single page while downloading a file then the page request goes time out and the server then closes the existing download stream and the client doestn't throw any exception. So many a...
5
5970
by: fniles | last post by:
We created an ActiveX control and marked it as safe for scripting using Implements IObjectSafety. We then created a CAB file and signed it using Verisign. We also created a license file (LPK file) for it. We use this control on an ASP page. We put the CAB file for the AX control and VBRun60.CAB in the same folder with all the ASP files. When we call the ASP page using any machine with IE 6 SP2 (we tried it with multiple IE6 SP2...
5
1605
by: Trapulo | last post by:
Hi, I've a big trouble with an asp.net page. Basically, the page has an swf that starts and downloads some data from an other asp.net page. The application works well on my testing IIS 6, but when I upload it on production server (an other IIS6), it cannot download anything. The application is in ASP.NET 2.0. The page with swf, the swf, and the page that renders data (as xml) are on the same domain and same web site. The site has form...
3
1725
by: xeroxero | last post by:
I would like to prevent people from downloading a .zip from a ASP.NET 2.0 web site, but still allow people to touch a .aspx page in the same directory. I also want to set things so if a user clicks on a button, the ASP.NET page will facilitate a download with Response.BinaryWrite. Is that possible? Thanks.
6
3766
by: cyusman | last post by:
Hi, We have just moved our application to a new webfarm server environment which utilizing hardware load balancing, SSL off-loading and HTTP compression off-loading.My application is running on .NET 1.1, IIS 6, Win2003. Now we are having problem when trying to download word documents located in the file server. It often says Internet Explorer cannot download <filenamefrom <servername>. Sometimes we are able to view
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9033
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.