liferealized/cfwheels-attachments — Issue #4: Error when i try to use Styles 
Author: Renand
Created: 2011-10-17 13:33:39+00:00
State: open

Hi, I have this return when I try to create a resized version with an image file.

Element FILE.URL is undefined in THIS.

The error occurred in E:\SITES\THALES_ARIBA\plugins\Attachments\attachments\model\callbacks.cfm: line 78
Called from E:\SITES\THALES_ARIBA\plugins\Attachments\attachments\model\callbacks.cfm: line 58
Called from E:\SITES\THALES_ARIBA\plugins\Attachments\attachments\model\callbacks.cfm: line 16
Called from E:\SITES\THALES_ARIBA\wheels\global\cfml.cfm: line 174
Called from E:\SITES\THALES_ARIBA\wheels\model\callbacks.cfm: line 291
Called from E:\SITES\THALES_ARIBA\wheels\model\crud.cfm: line 846
Called from E:\SITES\THALES_ARIBA\wheels\global\cfml.cfm: line 174
Called from E:\SITES\THALES_ARIBA\wheels\model\transactions.cfm: line 53
Called from E:\SITES\THALES_ARIBA\wheels\model\crud.cfm: line 816
Called from E:\SITES\THALES_ARIBA\wheels\model\crud.cfm: line 896
Called from E:\SITES\THALES_ARIBA\controllers\Products.cfc: line 232
Called from E:\SITES\THALES_ARIBA\wheels\global\cfml.cfm: line 174
Called from E:\SITES\THALES_ARIBA\wheels\controller\processing.cfm: line 85
Called from E:\SITES\THALES_ARIBA\wheels\controller\processing.cfm: line 60
Called from E:\SITES\THALES_ARIBA\wheels\dispatch\request.cfm: line 166
Called from E:\SITES\THALES_ARIBA\wheels\index.cfm: line 1
Called from E:\SITES\THALES_ARIBA\rewrite.cfm: line 1
Called from E:\SITES\THALES_ARIBA\wheels\events\onrequest.cfm: line 1
76 :	var loc = {};
77 :	loc.style = arguments.styles[arguments.style];
78 :	loc.image = ImageRead(ExpandPath(this.file.url));
79 :	loc.largerDimension = loc.image.height > loc.image.width ? "height" : "width";
80 :	loc.smallerDimension = loc.largerDimension == "width" ? "height" : "width";

I use this declaration :

hasAttachment(property="image", styles="medium:250x250,thumbnail:50x50", path="/images/:model/:id/:property/:style/:filename");

Thanks for your help