473,566 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.redire ctlocation does - without much
luck.
Dim filename As String = "C:\temp\p. jpg"
Response.Conten tType = "text/HTML"
Response.AddHea der("content-disposition", "attachment ; filename=" & fn)
Dim adoStream As ADODB.Stream = Server.CreateOb ject("ADODB.Str eam")
adoStream.Open( )
adoStream.Type = 1
adoStream.LoadF romFile(fn)
Response.Binary Write(adoStream .Read())
adoStream.Close () : adoStream = Nothing
Response.End()

TIA

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

Nov 17 '05 #1
2 1239
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******** ********@TK2MSF TNGP12.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.redire ctlocation does - without much luck.
Dim filename As String = "C:\temp\p. jpg"
Response.Conten tType = "text/HTML"
Response.AddHea der("content-disposition", "attachment ; filename=" & fn)
Dim adoStream As ADODB.Stream = Server.CreateOb ject("ADODB.Str eam")
adoStream.Open( )
adoStream.Type = 1
adoStream.LoadF romFile(fn)
Response.Binary Write(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*****@somewh ere.net> wrote in message
news:ey******** ********@TK2MSF TNGP12.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******** ********@TK2MSF TNGP12.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.redire ctlocation does - without

much
luck.
Dim filename As String = "C:\temp\p. jpg"
Response.Conten tType = "text/HTML"
Response.AddHea der("content-disposition", "attachment ; filename=" & fn)
Dim adoStream As ADODB.Stream = Server.CreateOb ject("ADODB.Str eam")
adoStream.Open( )
adoStream.Type = 1
adoStream.LoadF romFile(fn)
Response.Binary Write(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
5244
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 blank page and the earth on the top rigth corner keeps turning like it haven't read the pdf-file (for 10+ minutes on a lan). If I change the...
4
8399
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 for me :p ) Anyway I have a file dialog box being opened using Response.AddHeader "Content-Disposition", "attachment;filename=""" &...
2
6073
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 = Convert.ToByte(binString); Response.BinaryWrite(myBin); binString = "10111011"; myBin = Convert.ToByte(binString); Response.BinaryWrite(myBin); binString...
0
1363
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 sees as the Server Unavailable page I am aware of problems using Response.BinaryWrite or Response.WriteFile to download large files and so opted...
2
1349
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 frames so I changed this to a single page with both the entry form and the display rows on it which posts back to itself(an improvement i hope?) ok...
6
8106
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 picture of themselves to their profile... I admit that I'm a newbie... but this is how I understand this:
5
8822
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 being tested its not working and I am getting some weird results when testing. A month ago I was able to stream a file of size 80Mb and it worked like...
5
12040
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 script return me that file. But for security reason, I don't want to publish the address of this CGI, so I encapsulated it in an ASP file. This...
14
11881
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 downloaded using this method. I am hosting this site on a public server, so I will not be able to change anything on the webserver. Kindly indicate...
0
7666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
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...
0
8108
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...
1
7644
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7951
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6260
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...
0
5213
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...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2083
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

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.