473,624 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BinaryWrite Problem

Hi All,

Please help me regarding the 'Response.Binar yWrite' I am making one web
application where I need to store some of client logo's and others images.
In this context I am able to store images into .DB file and even able to
display into browser to. But it seems to be 'Response.Binar yWrite' does not
support 'html/text' hearder if you user 'BinaryWrite'? I had tried many way
to do so but its does not write binary if pages content <html><body> tag's.

I could had done it by uploading images into disk, which is quite simple
method and faster too<img src"images/<%=filename%>.j pg/gif"> by having
unique file name. But I am not the person who is going to monitor it as
user itself has a persmission through the web to have there image as they
want to give file name etc. Also I can't have individual directory for each
users as if tomorrow users grow then what I suppose to do?

Thanks,
Kevin.
Jul 19 '05 #1
1 3785
Hi,

If you want to display a webpage *and* an image, then you need to:

a) Response.Write( ) the HTML page, so that it contains a HTML <img> tag. You
point the src="" attribute to a special ASP page on your server, eg:

<img src="getImage.a sp?ImageID=1">

b) getImage.asp retrieves the image data and Response.Binary Write() it to
the client using the appropriate content type for the image, eg image/gif or
image/jpg. An image is *not* text/html - that's for the HTML page.

Remember you have to do this the way way a normal HTML page works. First the
browser downloads the HTML page - then it looks for <img> tags, and it
downloads the images separately. Each image request is a separate request.
Each request needs an appropriate response from the server, with the correct
ContentType.

Cheers
Ken

"Kevin Humphreys" <kh********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
: Hi All,
:
: Please help me regarding the 'Response.Binar yWrite' I am making one web
: application where I need to store some of client logo's and others images.
: In this context I am able to store images into .DB file and even able to
: display into browser to. But it seems to be 'Response.Binar yWrite' does
not
: support 'html/text' hearder if you user 'BinaryWrite'? I had tried many
way
: to do so but its does not write binary if pages content <html><body>
tag's.
:
: I could had done it by uploading images into disk, which is quite simple
: method and faster too<img src"images/<%=filename%>.j pg/gif"> by having
: unique file name. But I am not the person who is going to monitor it as
: user itself has a persmission through the web to have there image as they
: want to give file name etc. Also I can't have individual directory for
each
: users as if tomorrow users grow then what I suppose to do?
:
: Thanks,
: Kevin.
:
:
Jul 19 '05 #2

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

Similar topics

0
2185
by: B_O_B | last post by:
I am using Response.BinaryWrite to display JPEG's to the browser. The problem is that in IE, one particular JPEG is loading very slow. Normal JPEG's take a few seconds, but this one sometimes takes up to 30 seconds. THe weird thing is that if I refresh really quick, the JPEG appears for quick second, and then the new Response.BinaryWrite kicks in. So, it looks like the browser has the image, but for some reason it is not finishing...
2
6077
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 = "10111111";
2
1240
by: Vinay | last post by:
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...
5
1722
by: Gregory Silvano | last post by:
I have reproduced this problem on several machines (all different configs) and don't see anything wrong with the code. The code below (or very similar) is from Microsoft (help files, newsgroup posts, etc.) and available at several other resources on the Web. If you click on the LinkButton once or twice it works without problems. However, on the third (sometimes the second) click the browser hangs. It never even gets to a breakpoint in...
11
11378
by: Random | last post by:
I have tried all the Response methods I can think of (WriteFile, BinaryWrite, OutputStream) to write the byte array of a pdf file to the response. The result looks like it's trying, it comes up as a blank PDF file (without the Adobe toolbar that normally comes up). Here is the code I am using... '...fPDF is my Byte array '...I've already verified it is valid by writing the array to a physical file ("result.pdf") and opening it...
1
2102
by: Magnus | last post by:
I want to generate a report and display it as a pdf in a WebForm (RptForm). To generate the report I need to pass some (sometimes a lot of) parameters from a WebForm (WebForm1). The report looks fine when I use Response.BinaryWrite to create it: oStream = (MemoryStream)oRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); Response.Clear(); Response.Buffer= true; Response.ContentType = "application/pdf";
12
7623
by: Katie | last post by:
Hi, I am doing a binaryWrite to allow users to download files. The problem occurs if the file is too big. Some of the files i have are close to 100 megs. I read on msdn that if the data is greater than 4MB it is advisable to break it up into multiple chunks http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/04d5f44f-cc63-4465-b45f-634b95130b4a.asp How would that be done?
0
1060
by: Anish G | last post by:
Hi, I am trying to dispaly multiple label images in to a browser using response.binarywrite(). But the images are getting over written.I am attaching the code with this, Please help me out to solve this problem. protected void Page_Load(object sender, EventArgs e) { int count = Convert.ToInt32(Session); for (int i = 0; i { Response.ClearContent();
5
12060
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 way, only this ASP file knows where the CGI is.
0
8233
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8619
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...
1
8334
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
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...
0
4078
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
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
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.