Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > BinaryWrite Problem

Reply
Thread Tools

BinaryWrite Problem

 
 
Kevin Humphreys
Guest
Posts: n/a
 
      10-20-2003
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.


 
Reply With Quote
 
 
 
 
Ken Schaefer
Guest
Posts: n/a
 
      10-20-2003
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
: 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.
:
:


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BinaryWrite cause problem with browser Back button Magnus ASP .Net 1 05-24-2005 04:14 PM
.NET Bug with BinaryWrite or just bad code? Gregory Silvano ASP .Net 5 12-23-2003 03:57 PM
How can I user binarywrite and frames? Vinay ASP .Net 2 11-07-2003 09:53 PM
c#, binarywrite method. Nik ASP .Net 1 10-21-2003 07:43 AM
HOW-TO: Response.BinaryWrite JPG *WITH* the original filename DAC ASP .Net 1 07-31-2003 07:28 PM



Advertisments