fareed100
2009-02-24 06:12:54 UTC
I am trying to get a code to create a folder (ecgtemp) that is then renamed to
another name (#title#) based on a variable (title): Here is the error I am
getting:
The specified directory attribute
C:/ColdFusion8/wwwroot/ecardia/Images/ECG/ecgtemp cannot be renamed to
newdirectory C:\ColdFusion8\wwwroot\ecardia\Images\ECG\ECG Feb 23.
The exception occurred during a cfdirectory action="rename".
<cfquery name="Recordset1" datasource="ecardia">
SELECT *
FROM ecgquiz
ORDER BY ecgquiz.ecgid desc
</cfquery><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ECG-quiz-creator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-image: url();
}
.style2 {
color: #FFFF00;
font-weight: bold;
font-size: large;
}
.style4 {
font-size: large;
font-weight: bold;
}
.style47 {color: #000000}
.style59 {color: #000000; font-weight: bold; }
body,td,th {
font-family: Geneva, Arial, Helvetica, sans-serif;
}
.style60 {
font-size: small;
font-weight: bold;
}
.style62 {color: #FFFFFF; font-weight: bold; font-size: small; }
.style64 {color: #000000; font-weight: bold; font-size: small; }
.style65 {font-size: small}
.style68 { color: #000000;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
font-size: small;
}
-->
</style>
<link href="CCS.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF"
id="cross bar">
<!--DWLayoutTable-->
<tr align="center" valign="middle" bgcolor="#0066FF" class="style68">
<td width="10%"><a href="Master-admin.cfm"
class="style59">master-admin</a></td>
<td width="8%" height="23"><span class="style62"><a href="index.cfm"
class="style59">home</a></span></td>
<td width="10%"><span class="style64"><a href="login.cfm"
class="style59">log in</a> </span></td>
<td width="11%"><span class="style60"><a href="ECG-index.cfm"
class="style59">ECG quiz</a> </span></td>
<td width="17%"><span class="style60"><a href="EP-index.cfm"
class="style59">arrhythmia quiz</a> </span></td>
<td width="10%"><a href="sharecase.cfm" class="style59">case
sharing</a></td>
<td width="13%"><a href="literature.cfm" class="style59">recent
literature</a></td>
<td width="7%"><span class="style62"><a href="links.cfm"
class="style59">links</a></span></td>
<td width="14%"><span class="style65"><strong><a href="about.cfm"
class="style59">about e-cardia</a></strong></span></td>
</tr>
</table>
<cfif isdefined("submit1")>
<!---<cffile action="upload"
destination="/c:/Websites/3fgc3w/ecardia/Images/ECG/" filefield="E1"
nameconflict="makeunique">--->
<cffile action="upload"
destination="C:/ColdFusion8/wwwroot/ecardia/Images/ECG/ecgtemp" filefield="E1"
nameconflict="makeunique">
<!---Fathi: for the publsihed verions use the following path: <cffile
action="upload" destination="/c:/websites/3fgc3w/ecardia/Images/ECG/ecgtemp"
filefield="E1" nameconflict="makeunique">--->
<cfelseif isdefined("submit2")>
<!---<cfquery name="quizset" datasource="ecardia">
Update ecgquiz set active=0
</cfquery>--->
<cfquery name="getecgcolor" datasource="ecardia">
SELECT ecgcolor from colors where choice= '#level#'
</cfquery>
<cfquery name="quizset2" datasource="ecardia" >
INSERT INTO ecgquiz([title], [hx], [Q], [a], [i1], [pending], [level],
[ecgcolor], [posted])
VALUES ('#title#', '#history#', '#question#','#answer#', '#uploadedfile#',
yes, '#level#', '#getecgcolor.ecgcolor#', '#dateFormat(now())#')
</cfquery>
<cfdirectory directory="C:/ColdFusion8/wwwroot/ecardia/Images/ECG/ecgtemp"
action="rename" newdirectory="#title#" >
<!---Fathi: this is the code that is for the published version: <cfdirectory
directory="C:/Websites/3fgc3w/ecardia/Images/ECG/ecgtemp" action="rename"
newdirectory="#title#" >--->
<!---The above code will change the name of the temporary directory "ecgtemp"
to a new name that is based on the title of the ECG quiz that is the same as
the "text field" --->
<cflocation url="ECG-admin.cfm">
<!--- Fathi: in this case I struggled to make the query work, if I take the
textfield value "level" out it will work, however, when it is there it does not
work and gives an error. Eventually when I used the brackets [ ] for all the
items it worked. Apparently there some names, one of them is "level" , that are
reserved for the program so you cannot use them as a value or varialbe unless
you specify that to the program by putting the brackets. A similar problem
happend in the file called: literature-admin where names like: source, ...etc
where not accepted unless bracketed. --->
</cfif>
<div align="center">
<table width="99%" border="2" bordercolor="#000000" id="ECG admin">
<tr>
<th align="left" valign="top" bgcolor="#000000" scope="col"><p
align="center" class="style2">eCardia administration </p> </th>
</tr>
<tr>
<th height="892" align="left" valign="top"
background="/ecardia/Images/other-pages/bg_T_12Y.gif" bgcolor="#FFFFFF"
scope="col"><div align="center">
<p class="style4">ECG Quiz Creator </p>
<form action="" method="post" name="form1">
<div>
<div align="center">
<cfif isdefined("Submit1")>
<cfoutput><img src="images/ecg/ecgtemp/#cffile.serverfile#">
<input type="hidden" name="uploadedfile"
value="#cffile.serverfile#">
</cfoutput>
</cfif>
</div>
</div>
<p align="center"><strong>Title:</strong>
<input name="title" type="text" id="title" value="">
</p>
<p align="center"><strong>level:</strong>
<select name="level" id="level">
<option>Green</option>
<option > Orange</option>
<option >Red</option>
</select>
<!-- Fathi: Here is we added a menu form and it was
named:"level". The actual values (i.e., green, orange, red) will be labelled
"#level#". -->
</p>
<p align="center"><strong>History:</strong></p>
<p align="center">
<textarea name="history" cols="110" rows="6" wrap="PHYSICAL"
id="history"></textarea>
</p>
<p align="center"><strong>Question:</strong></p>
<p align="center">
<textarea name="question" cols="110" rows="6" wrap="PHYSICAL"
id="question"></textarea>
</p>
<p align="center"><strong>Answer:</strong></p>
<p align="center">
<textarea name="answer" cols="110" rows="16" wrap="PHYSICAL"
id="textarea"></textarea>
</p>
<p align="center">
<input type="submit" name="Submit2" value="Submit" >
</p>
</form>
<p class="style4"> </p>
</div></th>
</tr></table>
</div>
</body>
</html>
another name (#title#) based on a variable (title): Here is the error I am
getting:
The specified directory attribute
C:/ColdFusion8/wwwroot/ecardia/Images/ECG/ecgtemp cannot be renamed to
newdirectory C:\ColdFusion8\wwwroot\ecardia\Images\ECG\ECG Feb 23.
The exception occurred during a cfdirectory action="rename".
<cfquery name="Recordset1" datasource="ecardia">
SELECT *
FROM ecgquiz
ORDER BY ecgquiz.ecgid desc
</cfquery><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ECG-quiz-creator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-image: url();
}
.style2 {
color: #FFFF00;
font-weight: bold;
font-size: large;
}
.style4 {
font-size: large;
font-weight: bold;
}
.style47 {color: #000000}
.style59 {color: #000000; font-weight: bold; }
body,td,th {
font-family: Geneva, Arial, Helvetica, sans-serif;
}
.style60 {
font-size: small;
font-weight: bold;
}
.style62 {color: #FFFFFF; font-weight: bold; font-size: small; }
.style64 {color: #000000; font-weight: bold; font-size: small; }
.style65 {font-size: small}
.style68 { color: #000000;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
font-size: small;
}
-->
</style>
<link href="CCS.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF"
id="cross bar">
<!--DWLayoutTable-->
<tr align="center" valign="middle" bgcolor="#0066FF" class="style68">
<td width="10%"><a href="Master-admin.cfm"
class="style59">master-admin</a></td>
<td width="8%" height="23"><span class="style62"><a href="index.cfm"
class="style59">home</a></span></td>
<td width="10%"><span class="style64"><a href="login.cfm"
class="style59">log in</a> </span></td>
<td width="11%"><span class="style60"><a href="ECG-index.cfm"
class="style59">ECG quiz</a> </span></td>
<td width="17%"><span class="style60"><a href="EP-index.cfm"
class="style59">arrhythmia quiz</a> </span></td>
<td width="10%"><a href="sharecase.cfm" class="style59">case
sharing</a></td>
<td width="13%"><a href="literature.cfm" class="style59">recent
literature</a></td>
<td width="7%"><span class="style62"><a href="links.cfm"
class="style59">links</a></span></td>
<td width="14%"><span class="style65"><strong><a href="about.cfm"
class="style59">about e-cardia</a></strong></span></td>
</tr>
</table>
<cfif isdefined("submit1")>
<!---<cffile action="upload"
destination="/c:/Websites/3fgc3w/ecardia/Images/ECG/" filefield="E1"
nameconflict="makeunique">--->
<cffile action="upload"
destination="C:/ColdFusion8/wwwroot/ecardia/Images/ECG/ecgtemp" filefield="E1"
nameconflict="makeunique">
<!---Fathi: for the publsihed verions use the following path: <cffile
action="upload" destination="/c:/websites/3fgc3w/ecardia/Images/ECG/ecgtemp"
filefield="E1" nameconflict="makeunique">--->
<cfelseif isdefined("submit2")>
<!---<cfquery name="quizset" datasource="ecardia">
Update ecgquiz set active=0
</cfquery>--->
<cfquery name="getecgcolor" datasource="ecardia">
SELECT ecgcolor from colors where choice= '#level#'
</cfquery>
<cfquery name="quizset2" datasource="ecardia" >
INSERT INTO ecgquiz([title], [hx], [Q], [a], [i1], [pending], [level],
[ecgcolor], [posted])
VALUES ('#title#', '#history#', '#question#','#answer#', '#uploadedfile#',
yes, '#level#', '#getecgcolor.ecgcolor#', '#dateFormat(now())#')
</cfquery>
<cfdirectory directory="C:/ColdFusion8/wwwroot/ecardia/Images/ECG/ecgtemp"
action="rename" newdirectory="#title#" >
<!---Fathi: this is the code that is for the published version: <cfdirectory
directory="C:/Websites/3fgc3w/ecardia/Images/ECG/ecgtemp" action="rename"
newdirectory="#title#" >--->
<!---The above code will change the name of the temporary directory "ecgtemp"
to a new name that is based on the title of the ECG quiz that is the same as
the "text field" --->
<cflocation url="ECG-admin.cfm">
<!--- Fathi: in this case I struggled to make the query work, if I take the
textfield value "level" out it will work, however, when it is there it does not
work and gives an error. Eventually when I used the brackets [ ] for all the
items it worked. Apparently there some names, one of them is "level" , that are
reserved for the program so you cannot use them as a value or varialbe unless
you specify that to the program by putting the brackets. A similar problem
happend in the file called: literature-admin where names like: source, ...etc
where not accepted unless bracketed. --->
</cfif>
<div align="center">
<table width="99%" border="2" bordercolor="#000000" id="ECG admin">
<tr>
<th align="left" valign="top" bgcolor="#000000" scope="col"><p
align="center" class="style2">eCardia administration </p> </th>
</tr>
<tr>
<th height="892" align="left" valign="top"
background="/ecardia/Images/other-pages/bg_T_12Y.gif" bgcolor="#FFFFFF"
scope="col"><div align="center">
<p class="style4">ECG Quiz Creator </p>
<form action="" method="post" name="form1">
<div>
<div align="center">
<cfif isdefined("Submit1")>
<cfoutput><img src="images/ecg/ecgtemp/#cffile.serverfile#">
<input type="hidden" name="uploadedfile"
value="#cffile.serverfile#">
</cfoutput>
</cfif>
</div>
</div>
<p align="center"><strong>Title:</strong>
<input name="title" type="text" id="title" value="">
</p>
<p align="center"><strong>level:</strong>
<select name="level" id="level">
<option>Green</option>
<option > Orange</option>
<option >Red</option>
</select>
<!-- Fathi: Here is we added a menu form and it was
named:"level". The actual values (i.e., green, orange, red) will be labelled
"#level#". -->
</p>
<p align="center"><strong>History:</strong></p>
<p align="center">
<textarea name="history" cols="110" rows="6" wrap="PHYSICAL"
id="history"></textarea>
</p>
<p align="center"><strong>Question:</strong></p>
<p align="center">
<textarea name="question" cols="110" rows="6" wrap="PHYSICAL"
id="question"></textarea>
</p>
<p align="center"><strong>Answer:</strong></p>
<p align="center">
<textarea name="answer" cols="110" rows="16" wrap="PHYSICAL"
id="textarea"></textarea>
</p>
<p align="center">
<input type="submit" name="Submit2" value="Submit" >
</p>
</form>
<p class="style4"> </p>
</div></th>
</tr></table>
</div>
</body>
</html>