I'm trying to debug a problem with imageCFC on a client's server.
He's using a GoDaddy VPS... it appears to be running Coldfusion 7.0.1
standard edition.

Java is apparently incapable of writing files to the filesystem, even
though Coldfusion has no problem.

Take the following code, for example.... the cffile statement runs
correctly, although java thinks it cannot write to the file (it can't,
I've tried).

So how is it that Coldfusion can write a file when Java cannot?

<!--- create a java file object --->
<cfset outFile = CreateObject("java", "java.io.File")>
<!--- path to the file we want to write --->
<cfset tempOutputFile = "#ExpandPath(".")#\#createUUID()#.txt">
<!--- initialize the file object with the path --->
<cfset outFile.init(tempOutputFile)>
<!--- can java write to this file? --->
<cfif NOT outFile.canWrite()>
        <!--- have coldfusion write to the file --->
        <cffile action="WRITE" file="#tempOutputFile#" output="Java could not
write to #tempOutputFile#" addnewline="yes">
        <!--- throw an error now, since coldfusion successfully wrote to the 
file --->
        <cfthrow message="Permission Error" detail="Java does not seem to be
able to write to #tempOutputFile# - even though Coldfusion can.">
<cfelse>
        <h3>Java can write to this file!</h3>
        <cfoutput>#tempOutputFile#</cfoutput>
</cfif>

Thanks.

Rick


-- 
Rick Root
Check out CFMBB, BlogCFM, ImageCFC, ImapCFC, CFFM, and more at
www.opensourcecf.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286555
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to