Skip to main content
BreakawayPaul
Inspiring
May 31, 2013
Question

cfimage resize problem

  • May 31, 2013
  • 6 replies
  • 1125 views

I have a page that controls our staff directory, including uploading photos of staff members.

I have a form with a browse button, and it successfully uploads the picture.  Where it fails is resizing both the photo and the thumbnail.

Here's the code I'm using for the resize:

<cfset source = "D:\Inetpub\staffnet_test\hep\bios\#lcase(filename)#">

<cfset destination = "D:\Inetpub\staffnet_test\hep\bios\thumbs\#lcase(filename)#">

<!--- resize main image --->

<cfimage

    action="resize"

    height="180"

    width="240"

    source="#source#"

    destination="#source#"

    overwrite="yes">

<!--- resize thumb --->

<cfimage

    action="resize"

    height="90"

    width="120"

    source="#destination#"

    destination="#destination#"

    overwrite="yes">

The "source" location is where the fullsize image is first uploaded.  The first section of code resizes that pic.  The second creates a thumbnail.  It fails with the following error:

An exception occured while trying to write the image.

Ensure that the destination directory exists and that Coldfusion has permission to write to the given path or file. cause : java.io.FileNotFoundException: D:\Inetpub\staffnet_test\hep\bios\kevin.adderly.jpg (The system cannot find the file specified)

The error occurred in D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 100

Line 100 is the first overwrite="yes" line.  Any ideas?  I'm running CF 8.01

    This topic has been closed for replies.

    6 replies

    WolfShade
    Legend
    May 31, 2013

    Are you sure the file is successfully reaching the upload folder?  Are you sure that the file is being copied to the source folder, if it's different from the upload folder?  Do all folders give the user account for CF permissions for write?

    ^_^

    BreakawayPaul
    Inspiring
    May 31, 2013

    Yep, the file (huge file) successfully uploads to both locations.  They're both 2.4MB instead of the 71KB that the older pics are (or 41KB for thumbs).  The files are there, but as to whether there are file permissions issues, I have no idea.  CF here runs under the system account, so it seems like it should have rights to do just about anything.

    WolfShade
    Legend
    May 31, 2013

    File not found is pretty specific.  There has to be something preventing CF from "seeing" the files.

    ^_^