By default the Response.ContentType is set to text/html which will allow for the content to be written to and understood by the browser.
If you change the content type, browsers can no longer understand what has been sent to them since they cannot interpert anything except text/html.
If you change content type then the content needs be opened with an application that understands that content type.
I'm not sure if this helps you at all as I'm not quite clear on what you are trying to do.
Hi :)
Here is the code :
<%
set conn=server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.jet.OLEDB.4.0"
conn.Open "F:/projet/test1.mdb"
set rs= conn.Execute("SELECT photo FROM photos where ID=1")
Response.ContentType="image/jpg"
Response.BinaryWrite(rs("photo"))
conn.Close
%>
Normally i would expect to see a image from the database
But the only thing I got is tons of ascii characters like this : $ÿÿÿÿPackagePackage
Another problem
And now after some refresh (code hasnt change) Internet Explorer give me a messagebox with prompts as follows:
==================================
Title: File Download - Security Warning
Name: Setup.exe
From: localhost
Buttons: [Run] [Save] [Cancel]
While files from internet can be useful, this file type can potentially harm your computer. If you do not trust the source, do not run or save this software. (link: ) What's the risk?
================================
i copy paste the code in a new asp file
it works like 3 or 4 times (doing some refresh) and then the messagebox come back.
I try other browser like Firefox and Opera and its the same thing
I tried to change security level for intranet too, but i don't know which parameter to change.
thanx for your help
Chris