Abinidi wrote:
> or...
>
> <cfset image_name ="C:\pathtofile\imagefile.jpg">
>
> <cfscript>
> imgFile =
createObject("java","javax.swing.ImageIcon").init("#image_name#");
> imgFile.getImage();
> w = imgFile.getIconWidth();
> h = imgFile.getIconHeight();
> </cfscript>
>
> <cfoutput>width="#w#" height="#h#</cfoutput>
>
>
> Adjust code accordingly to what you are doing.
>
i am trying to use the above code to check for dimensions of
uploaded
image and delete the image (through cffile action=delete) if
its
dimensions are different from required. the checking part
works fine,
but i am unable to delete the image!
CF trows an error:
ColdFusion could not delete the file "[full path to
file]\[filename]"
for an unknown reason.
the path is correct, the file is there, and i can delete it
manually
without a problem, but not with cffile action=delete...
any ideas? does that have something to do with the
instantiated java
object? how do i de-instantiate it?
--
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com