Joel,

Here is a run down on paths in ColdFusion (include ExpandPath()):

http://www.bennadel.com/blog/597-ColdFusion-Path-Usage-And-Manipulation-
Overview.htm
{or http://bennadel.com/index.cfm?dax=blog:597.view}

ExpandPath() goes relative the currently executing page. Since that page
is in the upload-image directory (I assume this is the "upload" in the
dir structure below), you would need to use the image directory from
within the "current" directory:

#ExpandPath( "./images/" )# 

<cffile 
action="UPLOAD" 
filefield="Filedata" 
destination="#ExpandPath( "./images/#url.id#" )#" 
nameconflict="OVERWRITE"
/>

I assume that URL.id is the name of the image to be uploaded. CAUTION:
In newer versions of CF, this "bug" is no longer valid. It will actually
create a directory names #URL.id# and then store the uploaded file in
that. CFFILE-Upload should ONLY use a destination directory, NOT a file
name.

Hope some of that helps.


......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Joel Watson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 27, 2007 8:51 AM
To: CF-Talk
Subject: ExpandPath help

I am attempting to modify a flash form that I downloaded off of
ASFusion.  Currently, my upload file (uploadimage.cfm) is in a folder
called "upload-image" which is one level off the root.  I want to be
able to upload the images to a folder called "images" within the
upload-image folder.  Visually, it looks like this:

root (dir)
    upload (dir)
         uploadimage.cfm
         images (dir)

Currently, the "expandpath" drops the images in the same folder as the
form file (uploadimage.cfm).  How would I modify the following to place
the uploaded files in the "images" folder?  Also, I have not had any
experience thus far (being pretty new to CF) with "expandpath"--if
someone could make a short note of explanation, I would appreciate that
also!

<cffile action="UPLOAD" filefield="Filedata"
destination="#expandpath(".")#\#url.id#" nameconflict="OVERWRITE">  


Thanks!

Joel
</cfif>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

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

Reply via email to