Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / April 2006



Tip: Looking for answers? Try searching our database.

cfcontent question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
_fb_ - 08 Feb 2006 18:23 GMT
Hi All,
Well, i use an Application.cfm to secure pdf files access in a web site.
I've modifed wwwroot/WEB-INF/web.xml file to declare :
    <servlet-mapping>
        <servlet-name>CfmServlet</servlet-name>
        <url-pattern>*.pdf</url-pattern>
    </servlet-mapping>
then, when a user try to get a pdf file with input directly url in the
browser, Application.cfm  works and decide if user has
good profile to get this document.
The mistake is that if in the pdf file source there is <cf.... , CFML compiler
generates an error.
It works fine with CF 4.5, but not in MX 6.01.
Is there any work around ?
Thanx a lot.
Fabrice
jsmallwood - 09 Feb 2006 20:58 GMT
First of all, as a general rule, content/files you want to protect using a web
application should not be in the webroot of the server (or they should be
protected by server ACLs).  It is safer to keep your content (pdf) and script
(cfm) files in separate directory trees on the server.

But given that you're trying this setup, maybe you can use cftry/cfcatch in
your application.cfm file and just ignore any errors that occur when pdf files
are requested? Just go ahead and cfcontent the file from your application.cfm
whether you catch an error or not.
_fb_ - 10 Feb 2006 16:53 GMT
Hi Jeff,

thanx for your answer.
Well pdf documents and cfm templates are not in the same directory
but pdf documents are accessible from web application, as condition as you are
identified.
I don't want that a non-identified user can access to this document, and i
don't want
to give system privileges to identified users (when i say i don't, understand
project don't want :-) )
Could you think that it's possible to catch the error, because i try with
sipmle cfabort on my Application.cfm
and error appears (it's a compiler error).
Anyway i will try this catch and inform u about results.

Regards.

Fabrice
_fb_ - 10 Feb 2006 17:51 GMT
Well,

I cannot catch the error.
I think that the CFML compiler generates the error before Application.cfm
works (where i put cftry...)
It was ok with 4.5 but not with 6.1...
I'll have to find another workaround quickly, i don't know how..
Thanx.
Fabrice
mgetter - 28 Apr 2006 16:50 GMT
_fb_ - we just upgraded to MX7 from 5.0 and now we have the identical problem.  Have you ever found a solution?  Since it appears to be a compiler error - I am stumped...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.