Does ColdFusion have access to that drive? Can you generate a list of files,
and their permissions with cfdirectory for example?


andy 

-----Original Message-----
From: Matthew Smith [mailto:[email protected]] 
Sent: Monday, August 16, 2010 12:31 PM
To: cf-talk
Subject: image dimensions on mapped drive file


I need to get the dimensions of some images.  In my local environment, my
wwwroot is located on a mapped drive at:
\\awesome-pc\inetpub\wwwroot\

It is also mapped on the server as:
z:\wwwroot\

I found a couple of methods to get image dimensions, and am using the one
from this thread:
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33091

<http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33091> I am
getting:
Can't read input file!

I can go to the image on the server by putting in the path directly, so it
is accessable, but for some reason cf can't see it.  I know there is an
issue with null credentials on network assets, so everything is starting
under a user account.

How can I get this to work?

Passing:
\\awesome-pc\inetpub\wwwroot\domain_com\includes\www_domain_com\dev\images\p
roducts\image.jpg
or
z:\wwwroot\domain_com\includes\www_domain_com\dev\images\products\image.jpg

<cffunction name="ImageSize" returnType="struct" access="public">

      <cfargument name="FileLoc" type="string" required="Yes">

      <cfset jFileIn =
createObject("java","java.io.File").init(ARGUMENTS.FileLoc)>

      <cfset ImageInfo = StructNew()>
      <cfset ImageObject =
createObject("java","javax.imageio.ImageIO").read(jFileIn)>

      <cfset ImageInfo.ImgWidth = ImageObject.getWidth()>
      <cfset ImageInfo.ImgHeight = ImageObject.getHeight()>

      <cfreturn ImageInfo>

</cffunction>

--
Regards,
Matthew Smith




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336302
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to