Changing Directory
right code allows me upload temp directory. change directory path. how can change this? below code working with.
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
<cfparam name="dir" default="#gettempdirectory()#">
<cfset thistemplate=getfilefrompath(gettemplatepath())>
<cfif listlast("#dir#","\") ".">
<cfset dir=getdirectoryfrompath(dir)>
<cfelseif listlast("#dir#","\") "..">
<cfset dir=getdirectoryfrompath(left("#getdirectoryfrompath(dir)#",len(getdirectoryfrompath(dir) )-1))>
</cfif>
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
<cfparam name="dir" default="#gettempdirectory()#">
<cfset thistemplate=getfilefrompath(gettemplatepath())>
<cfif listlast("#dir#","\") ".">
<cfset dir=getdirectoryfrompath(dir)>
<cfelseif listlast("#dir#","\") "..">
<cfset dir=getdirectoryfrompath(left("#getdirectoryfrompath(dir)#",len(getdirectoryfrompath(dir) )-1))>
</cfif>
right code allows me upload temp directory. change directory path.
to upload arbitrary directory, say, c:\myuploads\, put (full) path in tag cffile, value of destination attribute. example,
<cffile action = "upload"
filefield = "mydocs"
destination = "c:\uploads\"
accept = "text/plain, text/html, application/msword"
nameconflict = "makeunique">
to upload arbitrary directory, say, c:\myuploads\, put (full) path in tag cffile, value of destination attribute. example,
<cffile action = "upload"
filefield = "mydocs"
destination = "c:\uploads\"
accept = "text/plain, text/html, application/msword"
nameconflict = "makeunique">
More discussions in Getting Started
adobe
Comments
Post a Comment