473,386 Members | 1,793 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,386 software developers and data experts.

response.binarywrite

I am writing a page which uses response.binarywrite to the client, after it
has completed sending the file I am interested in I want to display some
mesange like "download completed" etc...I am unable to set such javascript
.....

my code

Response.AddHeader "Content-Disposition", "attachment; filename=" &
objFile.Name
Response.AddHeader "Content-Length", objFile.Size
Response.ContentType = "application/octet-stream"
Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open
objStream.Type = 1 Response.CharSet = "UTF-8"
objStream.LoadFromFile(strAbsFile)
Response.BinaryWrite(objStream.Read)
objStream.Close
Set objStream = Nothing
Set objFile = Nothing Response.End

How can I display Windo.alert("download completed") after this code...I put
this code but doesnt work. Windo.alert is ignored. if I change the
window.alert location to some other part of the code then I dont get that
standard doenload dialog box which shows open or save options....moreover
firrefox behaves differently

thanks

Nov 19 '05 #1
1 2389
You'll not be able to do this in the same stream as the binary
is in if you expect the browser to render your binary.

--
Robbe Morris - 2004/2005 Microsoft MVP C#

Earn money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"abcd" <ab**@abcd.com> wrote in message
news:eH***************@TK2MSFTNGP10.phx.gbl...
I am writing a page which uses response.binarywrite to the client, after it
has completed sending the file I am interested in I want to display some
mesange like "download completed" etc...I am unable to set such javascript
....

my code

Response.AddHeader "Content-Disposition", "attachment; filename=" &
objFile.Name
Response.AddHeader "Content-Length", objFile.Size
Response.ContentType = "application/octet-stream"
Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open
objStream.Type = 1 Response.CharSet = "UTF-8"
objStream.LoadFromFile(strAbsFile)
Response.BinaryWrite(objStream.Read)
objStream.Close
Set objStream = Nothing
Set objFile = Nothing Response.End

How can I display Windo.alert("download completed") after this code...I
put this code but doesnt work. Windo.alert is ignored. if I change the
window.alert location to some other part of the code then I dont get that
standard doenload dialog box which shows open or save options....moreover
firrefox behaves differently

thanks


Nov 19 '05 #2

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

Similar topics

5
by: katrinaVictim | last post by:
Question: I get the eror listed at the bottom of the post. What can I do to make the response of the x1.send a "binary" type? Or, in general, how can I just "make this work"? <%@...
2
by: hoenes1 | last post by:
I've got an aspx-Page "SendFile.aspx" which is called by a Link on "ShowListOfFiles.aspx" and sends the file in the OnLoad Eventhandler. The filename to download is stored in a Session variable....
1
by: Sridhar | last post by:
Hi, I am trying to display a pdf file on the web. It is working fine but the Page_Load method is running twice before displaying the page. Here is the code that I am using Private Sub...
2
by: jhansl | last post by:
Hello, I am trying desperately how to find out if the bytes sent in a Response.BinaryWrite (or bytes written to Response.OutputStream) are ACTUALLY sent to the client. My problem is that I have...
2
by: ATS | last post by:
HOWTO Override ASP's Response output for 2003/IIS. Please help, I want to have an ASP page write back EVERYTHING to the ASP Response. That includes HTTP Headers. I want my ASP to look...
1
by: ChristopherABurns | last post by:
I have a very simple code snippet here: private void Page_Load(object sender, System.EventArgs e) { string filePath = Server.MapPath("\\Transcriber\\TranscriberTest\\"); string fileName =...
5
by: Katie | last post by:
Hi, I made a posting a while ago regarding doing a binarywrite of a large file in chunks and got a lot of helpful responses. I was able to make it work then. Unfortunately when the project is...
5
by: twiggy182 | last post by:
Hi, I really need you help because I'm not very familliar with ASP and I could not find any solution to my problem. To put you in situation, I have a CGI to which I send a file name, and that...
1
by: mattridings | last post by:
Hi gang, Have a script that works fine. However, it's really cpu intensive and I'm looking for suggestions on a) whether or not that's normal and if so b)a better way of doing it. Script is...
14
by: S N | last post by:
I am using the following code to hide the download url of files on my website. The code uses Response.Binarywrite to send file to the client. Kindly indicate the maximum size of the file that can be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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...

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.