Thanks Peter,

I had actually started off with "image/jpeg" instead of "image/pjpeg".  Same
deal.

The strange thing is that this all works if I go directly through the template
that uses the CFCONTENT tag.  I wonder what that means?

Cheers,

Tania




"Peter Janett" <[EMAIL PROTECTED]> on 05-06-2001 05:44:02 PM

Please respond to [EMAIL PROTECTED]

To:   CF-Talk <[EMAIL PROTECTED]>
cc:
Subject:  Re: CFHeader and jpegs


Try removing the <CFHEADER> line altogether.  Another idea would be do mark
the jpgs as "image/jpeg", instead of "image/pjpeg".  Maybe the browser
doesn't like the progressive part of the jpg image type header.

Just some random ideas,

Peter Janett

New Media One Web Services
================================
WEB HOSTING FOR WEB DEVELOPERS
================================
Sun, IRIX, Windows 2000, Linux;
PHP, MySQL, Perl, Cold Fusion,
MS SQL, ASP, SSI, SSL
http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, June 05, 2001 1:29 AM
Subject: CFHeader and jpegs


> Hi,
>
> I'm developing an application that needs to protect images from directory
> snoopers and yet remains relatively easy to maintain.
>
> I've decided to use the CFCONTENT tag in conjuction with the CFHEADER tag
in
> order to push out images onto a page.
>
> However, the boss has decreed that users should be allowed to save these
images,
> and have the correct image name and type worked out for them in the dialog
box.
>
> I have used the following code for gif files:
>      <CFOUTPUT>
>           <img
src="#request.site.cfroot#/teststuff/index.cfm?fuseaction=getcontent&hreflin
k=#attributes.imgsrc#" border="0" alt="" usemap="##map1" ismap>
>      </CFOUTPUT>
> and this for jpg files:
>      <cfoutput>
>           <img
src="#request.site.cfroot#/teststuff/index.cfm?fuseaction=getcontent&hreflin
k=#attributes.photolink#" border="0" alt="">
>      </cfoutput>
>
> The teststuff/index.cfm file checks to see what sort of hreflink we have,
i.e. a gif or a jpg, and then assigns variables.filetype of "image/gif" or
> "image/pjpeg"
> respectively.  There is also a session variable that is set to the file
path (hidden from the webserver).
>
> In all, the final code used to push out the image is:
> <CFHEADER NAME="content-disposition" VALUE="inline;
filename=#variables.filename#">
> <cfcontent type="#variables.filetype#"
file="#request.site.contentpath##session.bams.imgsrc#" deletefile="No"
reset="yes">
>
> This is all on one line.  I have checked all of the variables and they are
translating correctly.
>
> Problem: This works just fine until the user wants to save the image on
the calling page and we're looking at a jpg file.  If we're looking at a gif
file
> everything works
> OK.  If we're looking at a jpg a right-click on the calling page gives the
user the option of saving the image as a BMP file, and gives it a filename
of
> "untitled".
>
> This is not what the boss wants!!
>
> If we copy the url from the image properties into the address bar, i.e. go
direct to the template doing the cfcontent (in this case
teststuff/index.cfm) and
> look at that
> very same jpg file, the file saves as a jpg with the correct filename.
Weird eh?
>
> Question:  Is there anything that could confuse a header into thinking
that it should be publishing a jpg file as  a bitmap?
>
> Any clues/help/insights/war stories would be greatly appreciated.
>
> Cheers,
>
> Tania
>
>
>
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to