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

BinaryWrite Problem

Hi All,

Please help me regarding the 'Response.BinaryWrite' 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.BinaryWrite' 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%>.jpg/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 3767
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.asp?ImageID=1">

b) getImage.asp retrieves the image data and Response.BinaryWrite() 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********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
: Hi All,
:
: Please help me regarding the 'Response.BinaryWrite' 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.BinaryWrite' 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%>.jpg/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
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...
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 =...
2
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...
5
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...
11
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...
1
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...
12
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...
0
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...
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...
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: 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
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
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
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,...
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.