1) I'm trying to save file into the folder - absolute path:
c:\coldfusion8\wwwroot\mysite\Images_tools\images. After that I'm
trying to set image variable.
2) Action file test.cfm includes only code below and situates
in the Images_tools folder.
Code:
<cfform enctype="multipart/form-data">
<cfinput type="file" name="Artfoto">
<cfinput type="submit" name="vov">
</cfform>
<cfset thisDir = ExpandPath(".")>
<cfif structKeyExists(form,"Artfoto") and
len(trim(form.Artfoto))>
<cffile action="upload" fileField="Artfoto"
destination="#thisDir#" result="fileUpload"
nameconflict="makeunique">
<cfif fileUpload.fileWasSaved>
<cfif IsImageFile("#fileUpload.serverfile#")>
<cfimage action="read" source="#fileUpload.serverfile#"
name="test">
</cfif>
</cfif>
</cfif>
<!--- result after submit ---->
<cfdump var="#fileUpload.serverfile#">
<cfdump var="#test#">
So, with ExpandPath(".") all work perfect, but file uploads
to Images_tools directory NOT to Images, like I need.
If you replace <cfset thisDir = ExpandPath(".")> by
<cfset thisDir = ExpandPath ("images")> or another
equivalent ( /images, \images, ..\images,
c:\coldfusion8\wwwroot\mysite\images) , you would see in
<cfdump> that variable #fileUpload.serverfile# exists and
#test# gives us a error.
I don't understand that!!! However with ExpandPath(".") it
works perfect, WHY???!!!
How to write a correct path in ExpandPath brackets?