Results 1 to 2 of 2
  1. #1
    Abina's Avatar
    Abina is offline Master
    Join Date
    Dec 2009
    Location
    United States
    Posts
    1,073
    Thanks
    1
    Thanked 6 Times in 4 Posts
    Feedback Score
    0

    Default Resize and upload the Image Error (Could not find the ColdFusion Component)

    It gives this error

    Could not find the ColdFusion Component or Interface Image.
    106 : <!--- create the object --->
    107 : <cfset myImage = CreateObject("Component","Image") />
    108 : <cfset myImage = CreateObject('Component', 'Image').setKey('68DPN-P2M2E-X8CRC-7DBVA-RXXB0') />
    109 :
    Code:
    <cfset Image1 = createuuid()>
    <cfset Image1 = #Image1# & ".jpg">
    
    <cffile action="upload" filefield="file" destination="#imageFolderPath#" nameconflict="MakeUnique" accept="image/*">
    			
    <cffile action="rename" source="#imageFolderPath#/#cffile.ServerFile#" destination="#imageFolderPath#/#Image1#">
    			
    			
    <!--- create the object --->
    <cfset myImage = CreateObject("Component","Image") />
    <cfset myImage = CreateObject('Component', 'Image').setKey('68DPN-P2M2E-X8CRC-7DBVA-RXXB0') />
    		
    <!--- open the image to resize --->
    <cfset myImage.readImage(imageFolderPath & Image1) />
    
    <cfset width = myImage.getWidth() />
    
    <cfif width gt 740>
    <!--- resize the image proportionally on the width --->
    <cfset myImage.scaleWidth(740) />
    </cfif>
    	
    <cfset height = myImage.getHeight() />
    <cfif height gt 520>
    <!--- resize the image proportionally on the height --->
    <cfset myImage.scaleHeight(520) />
    </cfif>
    		
    <!--- output the image in JPG format --->
    <cfset myImage.writeImage(imageFolderPathE & 'A' & Image1, "jpg") />

  2. #2
    numberone's Avatar
    numberone is offline Senior
    Join Date
    Jan 2010
    Posts
    623
    Thanks
    0
    Thanked 1 Time in 1 Post
    Feedback Score
    0

    Default

    It works fine on old web server, but stop working on new server.
    Without knowing anything about your paths or mappings, the error suggests a missing mapping. If you have upgraded versions ie 6/7 to CF8, also check into reserved words. I'm not sure if "Image" is one ...

Similar Threads

  1. Client Side Image Upload and Crop Tool
    By manik in forum Web Development - Programming & Coding
    Replies: 1
    Last Post: 03-10-2009, 01:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Partners: BOSTON WEB DEVELOPER, LLC   |   WEBCOSMO CLASSIFIEDS