Link to home
Start Free TrialLog in
Avatar of yysun
yysun

asked on

Can I use ASP to write a image?

I used a lot response.write to write text into HTML file. Can I and how can I write a image into the html file. I found that there is a function named response.binarywrite, but don't know how to use it? I would be very appretiate if anybody could give me an advice.
ASKER CERTIFIED SOLUTION
Avatar of sybe
sybe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yysun
yysun

ASKER

Thank you sybe.

In the first Example, can you tell me what is DBMS and what is the filed type of "image"?

Can I first write some text then an image, e.g. Add
Response.write "hello"
before
Response.ContentType = "image/GIF"

finally, how can I develop an OLE Automation server to create the image?

1. I don't know what you mean by DBMS, I know it only from a property of the connection object, and it tells you what kind of database is in use.

2. The file type of the image does not really matter. Browsers will display a JPG ok, even if it is told that it's a GIF.

3. No, when you add any code before "Response.ContentType = .." then you get an error message.
If you write some output after ContentType = image/GIF, then the browser thinks that that text is part of the binary code of the image, and the browser is not able to display the image well (it shows a broken image).

4. You should NOT read the images into the database using OLE, even if you use a OLE-filed type. If you use OLE to get the image into the database, ACCESS will convert it to BMP and at the same time save the original format. So this will really destroy the binary code you want to have.
What you need is to use the AppendChunk function of VBA to read the image into the OLE-field as binary code.



Avatar of yysun

ASKER

I mean what type of database to use, SQL server or access or anything else.

And what is the FIELD type for the image data? (sorry for previous wrong type filed type)?

Thanks.