Hi Chris,
> 1. File exists on someone elses server, I have read-only
> authority.
> 2. File is actually a JPEG image, but is stored as xxxx.cpc.
> 3. Can I send that file to the browser in some fashion as a
> jpg, or must I first copy it so that I can rename it, then
> reference it with a standard image tag?
Yes. Here's a sample that'll need modified for your situation.
'// ========================================================
<%
sFilename = "x:\file.jpg"
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fil = fso.GetFile( sFilename )
' add as many headers as possible to facilitate the client
Response.AddHeader "Content-Length", fil.Size
Response.ContentType = "image/jpeg"
Response.CacheControl = "public"
' clean up
Set fil = Nothing
Set fso = Nothing
' read binary contents
Set oStream = Server.CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.LoadFromFile sFilename
' write binary contents
Response.BinaryWrite oStream.Read
' clean up
oStream.Close
Set oStream = Nothing
' terminate connection
Response.End
%>
'// ========================================================
Regards,
Shawn K. Hall
http://ReliableAnswers.com/
'// ========================================================
"When one has great gifts, what answer to the meaning of
existence should one require beyond the right to
exercise them?"
-- W. H. Auden
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~->
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [EMAIL PROTECTED]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/active-server-pages/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/