Errol Farro
asked on
Coldfusion rename file and place in another directory
I need the path name in order to rename a file. The user selects the file to be renamed and ColdFusion should rename the file.
My challenge is how to get the pathname of the selected file.
<!--- Check to see if the Form variable exists. --->
<cfif isDefined("Form.FileConten ts") >
<!---
<cffile
action = "rename"
destination = "pathname"
source = "full pathname"
attributes = "file attributes list"
mode = "mode"> --->a
<cfelse>
<!--- If FALSE, show the Form. --->
<form method="post" action=<cfoutput>#cgi.scri pt_name#</ cfoutput>
name="uploadForm" enctype="multipart/form-da ta">
<input name="FileContents" type="file">
<br>
<input name="submit" type="submit" value="Upload File">
</form>
</cfif>
My challenge is how to get the pathname of the selected file.
<!--- Check to see if the Form variable exists. --->
<cfif isDefined("Form.FileConten
<!---
<cffile
action = "rename"
destination = "pathname"
source = "full pathname"
attributes = "file attributes list"
mode = "mode"> --->a
<cfelse>
<!--- If FALSE, show the Form. --->
<form method="post" action=<cfoutput>#cgi.scri
name="uploadForm" enctype="multipart/form-da
<input name="FileContents" type="file">
<br>
<input name="submit" type="submit" value="Upload File">
</form>
</cfif>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.