473,406 Members | 2,847 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,406 software developers and data experts.

Popup is blocking my download, kindly let me know an alternative

375 256MB
Hi,

I wrote the following code in the page load event

Expand|Select|Wrap|Line Numbers
  1.  string path = clientServerXRef1.GetDownloadpath(company.ToUpper());
  2.             System.IO.FileStream fs = null;
  3.             fs = System.IO.File.Open(path + company.ToUpper() + "_" + projectID + ".mpp", System.IO.FileMode.Open);
  4.             byte[] btFile = new byte[fs.Length];
  5.             fs.Read(btFile, 0, Convert.ToInt32(fs.Length));
  6.             fs.Close();
  7.             Response.AddHeader("Content-disposition", "attachment; filename=" + projectID + ".mpp");
  8.             Response.ContentType = "application/octet-stream";
  9.             Response.BinaryWrite(btFile);
and called it inside frame to downlaod the file from the same page. I do other process like setting flag and messages in the database to make sure this is downloaded for the first time. If it is for the second time i supposed to give some different messages in the label.

Here it what happens

When the file downloads, it is getting blocked by the popup blocker. When i click and allow download, it reloads the page, hence it is showing the message for the second download rather than showing the first one.

Kindly let me know the solution

Regards
cmrhema
Jul 17 '09 #1
1 1860
Plater
7,872 Expert 4TB
You will have to get people who use your website to add it to the safe list (which hopefully means the download won't be blocked)
Either that or you need to discover a different way to determine if the file was actually downloaded.
Jul 20 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: dave yan | last post by:
hi, i have some forms which use javascript for data validation, e.g., checking to make sure all required fields are completed, checking that data falls within valid ranges for certain fields,...
38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
2
by: Maik | last post by:
I Need a popup-killer script
3
by: Mario | last post by:
Hello, I couldn't find a solution to the following problem (tried google and dejanews), maybe I'm using the wrong keywords? Is there a way to open a file (a linux fifo pipe actually) in...
3
by: Dan | last post by:
First, I'm sorry if this question has been asked too many times. I'm new to this news group. The question has to do with the use of popup windows in a web page. I have heard that popup windows...
3
by: Jeppe bob Dyrby | last post by:
I have a page that automaticly opens a small popup window, but it is only supposed to open this window once. A little info: function openwindow(name_var) { if (!name_var) { name_var =...
4
by: rovisoft | last post by:
Does anybody know how to pass a popup blocker to let popup windows and redirects work? Thanks,Ovidiu ----------------------------------- http://www.DevPlug.com -- Connecting Developers
15
by: | last post by:
So many websites can get around my Googlebar's popup blockers. Even Opera 8 can not stop those popups. I looked into the codes, and I can find nothing showing me how it is done. Can anyone help me...
5
by: Simon Knox | last post by:
Hi I have a web app that has a legitimate use for pop up windows. My web app is an insurance quoting app. I use the window.open method to display another aspx page so that the user can check...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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.