Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use path_translated to reaname file 1

Status
Not open for further replies.

leadman

Programmer
Joined
Jun 11, 2001
Messages
177
Location
US
Im using cffile to allow users to upload pictures. For the &quot;destination&quot; attribute i want to take the path to the template and add the filename to it. The problem is that when i use <cfset directory=&quot;#path_translated#newname.jpg&quot;> i get the path INCLUDING the name of the template at the end and then &quot;newname.jpg&quot;. For example, i tested this with a template named &quot;test.cfm&quot; and the result was this:

directory=D:\Inetsrv\ directoru\subdirectory\mphotos\test.cfmnewname.jpg

Is there a way to get just the path up to, but not including, the template name?
 
you can use this bit of code:

#GetDirectoryFromPath(GetCurrentTemplatePath())#

This will return in your case above:

D:\Inetsrv\ directoru\subdirectory\mphotos
hope this helps !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top