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

How can I user binarywrite and frames?

Hi All:

I have a frameset (right and left). In the left frame I have a listbox that
contains items. When the user clicks on any one of these items (each item
points to either a word document or an image) - I'd like to show this (image
or word document) in the frame on the right. Would anyone have any ideas on
how I can do this? The code I currently have is:

I am trying to figure out what response.redirectlocation does - without much
luck.
Dim filename As String = "C:\temp\p.jpg"
Response.ContentType = "text/HTML"
Response.AddHeader("content-disposition", "attachment; filename=" & fn)
Dim adoStream As ADODB.Stream = Server.CreateObject("ADODB.Stream")
adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(fn)
Response.BinaryWrite(adoStream.Read())
adoStream.Close() : adoStream = Nothing
Response.End()

TIA

Vinay
vi******@nospam.yahoo.com.nospam

Nov 17 '05 #1
2 1232
Vinay,

Since you haven't mentioned what your problem(s) you are encountering, I'm
going to guess that it's being caused by the declared content type. You
should be using the appropriate mime type for the actual content, and a jpg
is not of type text/HTML. Try using image/jpeg instead.

HTH,
Nicole
"Vinay" <vi*************@nospam.yahoo.com> wrote in message
news:ev****************@TK2MSFTNGP12.phx.gbl...
Hi All:

I have a frameset (right and left). In the left frame I have a listbox that contains items. When the user clicks on any one of these items (each item
points to either a word document or an image) - I'd like to show this (image or word document) in the frame on the right. Would anyone have any ideas on how I can do this? The code I currently have is:

I am trying to figure out what response.redirectlocation does - without much luck.
Dim filename As String = "C:\temp\p.jpg"
Response.ContentType = "text/HTML"
Response.AddHeader("content-disposition", "attachment; filename=" & fn)
Dim adoStream As ADODB.Stream = Server.CreateObject("ADODB.Stream")
adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(fn)
Response.BinaryWrite(adoStream.Read())
adoStream.Close() : adoStream = Nothing
Response.End()

TIA

Vinay
vi******@nospam.yahoo.com.nospam

Nov 17 '05 #2
Nicole:
Thanks for the input. What I'm trying to do is:

I have a frameset that has 2 pages (the one on the right and the one on the
left).
In the one on the left I have a button - when the user clicks this button I
want to use the binarywrite method to show the contents in the frame on the
right. If I were not using binarywrite I could use:
window.open (pagename.aspx), "_right"

How can I accomplish this using binarywrite?

TIA

Vinay
"Nicole Calinoiu" <ni*****@somewhere.net> wrote in message
news:ey****************@TK2MSFTNGP12.phx.gbl...
Vinay,

Since you haven't mentioned what your problem(s) you are encountering, I'm
going to guess that it's being caused by the declared content type. You
should be using the appropriate mime type for the actual content, and a jpg is not of type text/HTML. Try using image/jpeg instead.

HTH,
Nicole
"Vinay" <vi*************@nospam.yahoo.com> wrote in message
news:ev****************@TK2MSFTNGP12.phx.gbl...
Hi All:

I have a frameset (right and left). In the left frame I have a listbox

that
contains items. When the user clicks on any one of these items (each item points to either a word document or an image) - I'd like to show this

(image
or word document) in the frame on the right. Would anyone have any ideas

on
how I can do this? The code I currently have is:

I am trying to figure out what response.redirectlocation does - without

much
luck.
Dim filename As String = "C:\temp\p.jpg"
Response.ContentType = "text/HTML"
Response.AddHeader("content-disposition", "attachment; filename=" & fn)
Dim adoStream As ADODB.Stream = Server.CreateObject("ADODB.Stream")
adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(fn)
Response.BinaryWrite(adoStream.Read())
adoStream.Close() : adoStream = Nothing
Response.End()

TIA

Vinay
vi******@nospam.yahoo.com.nospam


Nov 17 '05 #3

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

Similar topics

2
by: Jens S0nderby Munk | last post by:
Hi, I'm having some problems with the Reponse.BinaryWrite, IE 6.0 and Adobe Reader 6.0. When I try to write a pdf-file to an IE browser with a Adobe Reader 6.0 installed then it just displays a...
4
by: Max Dupenois | last post by:
I've seen numerous articles with similair (similar sp?) titles to this in my search.. unfortunately none of them seem to contain what i want, (or if they do i need someone to point out my stupidity...
2
by: Nik | last post by:
I am trying to write out the equivalent of this asp statement in c#: Response.BinaryWrite(chrb(239) & chrb(187) & chrb(191)) 'BOM = EF BB BF string binString = "11111111"; byte myBin =...
0
by: Simon McCulloch | last post by:
Hi all I have an ASP.net website that uses an aspx page locate and stream a file to an authenticated user and I'm getting the error Aspnet_wp.exe (PID:XXXX) stopped unexpectedly which the user...
2
by: Wee Bubba | last post by:
i started by designing my web page using frames. i had my data entry form in an upper form and my data rows displaying in a lower frame. i soon discovered that ASP.NET is not really meant for...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a...
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.