Re: CFIMAGE - File referencing
I have my images for my project under the webroot folder in the e-dang folder under the image folder and in the consumer folder i.e. (wwwroot/e-dang/images/comsumer). But when I reference the file within my code (below), I realize in the error report that the path returned by coldfusion is missing the project folder name. Is this usual or does it mean that I got the referencing wrong? It looks to me that you got the referencing wrong. Here is a portion of the error report (NOTE - e-dang is missing from the image path): An exception occurred while trying to read the image. File C:\ColdFusion8\wwwroot\images\consumer\DSC_0515_thumb.jpg does not exist. The error occurred in C:\ColdFusion8\wwwroot\e-dang\process_simpleSearchResults.cfm: line 53 Here is the code: td width=10%!--- creating a resized version of uploaded image of product. --- cfimage source=#ExpandPath('/images/consumer/#Cnsmr_ProductIMAGE#' )# action=resize width=100 height=60 name=resizedImg format= jpg ... You're specifying a path of /images/consumer/..., when the path should be /e-dang/images/consumer/ The path starts from the web root by default, when you start it with /. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321808 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CFIMAGE - File referencing
Output #ExpandPath('/images/consumer/#Cnsmr_ProductIMAGE#) to see where you're pointing to, it'll be wrong. Adrian -Original Message- From: Fawzi Amadu [mailto:abd...@gmail.com] Sent: 20 April 2009 17:43 To: cf-talk Subject: CFIMAGE - File referencing I have my images for my project under the webroot folder in the e-dang folder under the image folder and in the consumer folder i.e. (wwwroot/e-dang/images/comsumer). But when I reference the file within my code (below), I realize in the error report that the path returned by coldfusion is missing the project folder name. Is this usual or does it mean that I got the referencing wrong? Here is a portion of the error report (NOTE - e-dang is missing from the image path): An exception occurred while trying to read the image. File C:\ColdFusion8\wwwroot\images\consumer\DSC_0515_thumb.jpg does not exist. The error occurred in C:\ColdFusion8\wwwroot\e- dang\process_simpleSearchResults.cfm: line 53 Here is the code: td width=10%!--- creating a resized version of uploaded image of product. --- cfimage source=#ExpandPath('/images/consumer/#Cnsmr_ProductIMAGE#' )# action=resize width=100 height=60 name=resizedImg format= jpg cfimage source=#resizedImg# action=writeToBrowser!---img src=images/consumer/#Cnsmr_ProductIMAGE#---/font/td td width=90%font size=+2#Cnsmr_ProductDESCRIPTION# /fontnbsp; font size=+2a href=showProductDetail.cfm?Cnsmr_ProductID=#URLEncodedFormat(TRIM(Cnsm r_ProductID))##Cnsmr_ProductMODELNo# /fontnbsp;/a font size=+2#Cnsmr_ProductMODELYEAR# /fontnbsp; font size=+2#Cnsmr_ProductPRICE#/fontnbsp; font size=+2#User_id#/font ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321811 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFIMAGE - File referencing
#ExpandPath('/images/consumer/#Cnsmr_ProductIMAGE#' )# because you have / in front of images CF assumes you are referencing the path from WEB ROOT, not from current template path - hence it looks in C:\ColdFusion8\wwwroot\images instead of in C:\ColdFusion8\wwwroot\e-dang\images try this instead: #ExpandPath('images/consumer/' Cnsmr_ProductIMAGE)# or #ExpandPath('/e-dang/images/consumer/' Cnsmr_ProductIMAGE)# Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Fawzi Amadu wrote: I have my images for my project under the webroot folder in the e-dang folder under the image folder and in the consumer folder i.e. (wwwroot/e-dang/images/comsumer). But when I reference the file within my code (below), I realize in the error report that the path returned by coldfusion is missing the project folder name. Is this usual or does it mean that I got the referencing wrong? Here is a portion of the error report (NOTE - e-dang is missing from the image path): An exception occurred while trying to read the image. File C:\ColdFusion8\wwwroot\images\consumer\DSC_0515_thumb.jpg does not exist. The error occurred in C:\ColdFusion8\wwwroot\e-dang\process_simpleSearchResults.cfm: line 53 Here is the code: td width=10%!--- creating a resized version of uploaded image of product. --- cfimage source=#ExpandPath('/images/consumer/#Cnsmr_ProductIMAGE#' )# action=resize width=100 height=60 name=resizedImg format= jpg cfimage source=#resizedImg# action=writeToBrowser!---img src=images/consumer/#Cnsmr_ProductIMAGE#---/font/td td width=90%font size=+2#Cnsmr_ProductDESCRIPTION# /fontnbsp; font size=+2a href=showProductDetail.cfm?Cnsmr_ProductID=#URLEncodedFormat(TRIM(Cnsmr_ProductID))##Cnsmr_ProductMODELNo# /fontnbsp;/a font size=+2#Cnsmr_ProductMODELYEAR# /fontnbsp; font size=+2#Cnsmr_ProductPRICE#/fontnbsp; font size=+2#User_id#/font ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321812 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CFIMAGE - File referencing
#ExpandPath('/images/consumer/#Cnsmr_ProductIMAGE#' )# because you have / in front of images CF assumes you are referencing the path from WEB ROOT, not from current template path - hence it looks in C:\ColdFusion8\wwwroot\images instead of in C:\ColdFusion8\wwwroot\e-dang\images try this instead: #ExpandPath('images/consumer/' Cnsmr_ProductIMAGE)# or #ExpandPath('/e-dang/images/consumer/' Cnsmr_ProductIMAGE)# Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Fawzi Amadu wrote: I have my images for my project under the webroot folder in the e-dang folder under the image folder and in the consumer folder i.e. (wwwroot/e-dang/images/comsumer). But when I reference the file within my code (below), I realize in the error report that the path returned by coldfusion is missing the project folder name. Is this usual or does it mean that I got the referencing wrong? Here is a portion of the error report (NOTE - e-dang is missing from the image path): An exception occurred while trying to read the image. File C:\ColdFusion8\wwwroot\images\consumer\DSC_0515_thumb.jpg does not exist. The error occurred in C:\ColdFusion8\wwwroot\e-dang\process_simpleSearchResults.cfm: line 53 Here is the code: td width=10%!--- creating a resized version of uploaded image of product. --- cfimage source=#ExpandPath('/images/consumer/#Cnsmr_ProductIMAGE#' )# action=resize width=100 height=60 name=resizedImg format= jpg cfimage source=#resizedImg# action=writeToBrowser!---img src=images/consumer/#Cnsmr_ProductIMAGE#---/font/td td width=90%font size=+2#Cnsmr_ProductDESCRIPTION# /fontnbsp; font size=+2a href=showProductDetail. cfm?Cnsmr_Produ ctID=#URLEncodedFormat(TRIM(Cnsmr_ProductID))##Cnsmr_ProductMODELNo# /fontnbsp;/a font size=+2#Cnsmr_ProductMODELYEAR# /fontnbsp; font size=+2#Cnsmr_ProductPRICE#/fontnbsp; font size=+2#User_id#/font ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321817 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFIMAGE - File referencing
Thanks a lot to all of you. Your explanation solved my problem. #ExpandPath('/images/consumer/#Cnsmr_ProductIMAGE#' )# because you have / in front of images CF assumes you are referencing the path from WEB ROOT, not from current template path - hence it looks in C:\ColdFusion8\wwwroot\images instead of in C:\ColdFusion8\wwwroot\e-dang\images try this instead: #ExpandPath('images/consumer/' Cnsmr_ProductIMAGE)# or #ExpandPath('/e-dang/images/consumer/' Cnsmr_ProductIMAGE)# Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Fawzi Amadu wrote: I have my images for my project under the webroot folder in the e-dang folder under the image folder and in the consumer folder i.e. (wwwroot/e-dang/images/comsumer). But when I reference the file within my code (below), I realize in the error report that the path returned by coldfusion is missing the project folder name. Is this usual or does it mean that I got the referencing wrong? Here is a portion of the error report (NOTE - e-dang is missing from the image path): An exception occurred while trying to read the image. File C:\ColdFusion8\wwwroot\images\consumer\DSC_0515_thumb.jpg does not exist. The error occurred in C:\ColdFusion8\wwwroot\e-dang\process_simpleSearchResults.cfm: line 53 Here is the code: td width=10%!--- creating a resized version of uploaded image of product. --- cfimage source=#ExpandPath('/images/consumer/#Cnsmr_ProductIMAGE#' )# action=resize width=100 height=60 name=resizedImg format= jpg cfimage source=#resizedImg# action=writeToBrowser!---img src=images/consumer/#Cnsmr_ProductIMAGE#---/font/td td width=90%font size=+2#Cnsmr_ProductDESCRIPTION# /fontnbsp; font size=+2a href=showProductDetail. cfm?Cnsmr_Produ ctID=#URLEncodedFormat(TRIM(Cnsmr_ProductID))##Cnsmr_ProductMODELNo# /fontnbsp;/a font size=+2#Cnsmr_ProductMODELYEAR# /fontnbsp; font size=+2#Cnsmr_ProductPRICE#/fontnbsp; font size=+2#User_id#/font ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321818 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4