Hello list.
I was wondering if anyone had any suggestions on the following problem - 
FileExists -
Actually - it may not be a problem but here is my question.

Are there better options to FileExists? Are they worth it - ie. does a 
file exist slow a page by alot? etc etc.

I find that for my clients, the more I can following a naming convention 
to pull product graphics - the better success I have had than storing 
image info in a database. Problem is - I must look for a gif then a jpg etc.

Any suggestions on cutting down this code below? Or should I leave well 
enough alone. I check to see if there is a pdf associated, then a gif or 
jpg pic...

<snip>
<cfif 
FileExists("d:\webs\printersource.com\documents\specsheets\#TRIM(lcase(replace(make, 
" ", "", "ALL")))#_#TRIM(lcase(replace(Model, " ", "", "All")))#.pdf")>
                <cfset PDFSpecAvailable = "Yes">
                <cfset PDFSpecLink = "/documents/specsheets/#TRIM(lcase(replace(make, 
" ", "", "ALL")))#_#TRIM(lcase(replace(Model, " ", "", "All")))#.pdf">
                <cfelse>
                <cfset PDFSpecAvailable = "No">
                </cfif>
                <!-- look for jpg -->
                <cfif 
FileExists("d:\webs\printersource.com\img\printers\#TRIM(lcase(replace(make, 
" ", "", "ALL")))#_#TRIM(lcase(replace(Model, " ", "", "All")))#_mini.jpg")>
                <cfset ImageThumbFile = "#TRIM(lcase(replace(make, " ", "", 
"ALL")))#_#TRIM(lcase(replace(Model, " ", "", "All")))#_mini.jpg">
                <img src="/img/printers/#ImageThumbFile#">
                <cfset LookForGif = "Yes">
                <br>
                </cfif>
                <!-- look for .gif-->
                <cfif LookForGif EQ "Yes" AND 
FileExists("d:\webs\printersource.com\img\printers\#TRIM(lcase(make))#_#TRIM(lcase(replace(Model,
 
" ", "", "All")))#_mini.gif")>
                <cfset ImageThumbFile = "#TRIM(lcase(replace(GetHardware.make, " ", 
"", "ALL")))#_#TRIM(lcase(replace(Model, " ", "", "All")))#_mini.gif">
                <img src="/img/printers/#ImageThumbFile#" height="66" border="0"><br>
                </cfif>

output is starts out something like this -  but above is relevant to my 
question.
                <span class="ModelHdr">#Make# #Model#</span><br>#mSpeed#<cfif cSpeed 
IS NOT "">/#cSpeed#</cfif> #mSpeedBy#<br>
                <cfif PDFSpecAvailable EQ "Yes"><a 
href="http://64.234.202.48/#PDFSpecLink#"; target="_new"><img 
src="/img/icon_PDFAvailable1.gif" border="0"></a><cfelse>Call 
800-774-9174</cfif>


Thanks in advance!!!
jay miller

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to