"#ExpandPath('./images')#/#url.id#"
.. means current directory, so ExpandPath('.') is simply gettnig the full path
of the current directory.
Hence './images' means the images path off the current directory.
Not relevant to this, but useful to know:
... means parent directory. So you can do ExpandPath('../something') to get to
a something directory at the same level as your upload directory.
For this reason, it can be a good idea to ensure any user-submitted variables
do not have .. within them, as this can potentially be dangerous in certain
circumstances.
> 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 robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273836
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4