Please tell me why I am unable to upload images using CFFILE
The error comes in the first CFFILE tag of UPLOADBANNER.CFM
-----------------ERROR in UPLOADBANNER.CFM----------
The directory specified in the DESTINATION attribute of the CFFILE tag (i:\maxwell\banners\get_well.jpg) is not valid. The directory either does not exist or is not accessible by the ColdFusion service.
------------------------------------------------------
<----------ADDBANNER.CFM-------------------->
-----------JavaScript Function-------------
function getrealfilename(frm)
{
var thefile=banr.bigad.value;
var thefile1=banr.smallad.value;
var fullname=thefile.substring(thefile.lastIndexOf('\\')+1,thefile.length);
var fullname1=thefile1.substring(thefile1.lastIndexOf('\\')+1,thefile1.length);
banr.name.value=fullname;
banr.nam.value=fullname1;
}
------------HTML CODE-----------------
<form enctype="multipart/form-data" name="banr" method="post" action="uploadbanner.cfm" onsubmit="getrealfilename(this.form)">
Choose the file for the Big Banner<br>
<input type="file" name="bigad"><br><p>
Choose the file for Small Banner<br>
<input type="file" name="smallad"><p>
<input type="hidden" name="name" value="">
<input type="hidden" name="nam" value="">
<input type="submit" name="submit" value="Upload">
</form>
<--------------UPLOADBANNER.CFM----------------->
<cffile action="UPLOAD" destination="i:\maxwell\banners\#form.name#" nameconflict="OVERWRITE" filefield="bigad">
<cffile action="UPLOAD" destination="i:\maxwell\banners\#form.nam#"
nameconflict="OVERWRITE" filefield="smallad">
The error comes in the first CFFILE tag of UPLOADBANNER.CFM
-----------------ERROR in UPLOADBANNER.CFM----------
The directory specified in the DESTINATION attribute of the CFFILE tag (i:\maxwell\banners\get_well.jpg) is not valid. The directory either does not exist or is not accessible by the ColdFusion service.
------------------------------------------------------
<----------ADDBANNER.CFM-------------------->
-----------JavaScript Function-------------
function getrealfilename(frm)
{
var thefile=banr.bigad.value;
var thefile1=banr.smallad.value;
var fullname=thefile.substring(thefile.lastIndexOf('\\')+1,thefile.length);
var fullname1=thefile1.substring(thefile1.lastIndexOf('\\')+1,thefile1.length);
banr.name.value=fullname;
banr.nam.value=fullname1;
}
------------HTML CODE-----------------
<form enctype="multipart/form-data" name="banr" method="post" action="uploadbanner.cfm" onsubmit="getrealfilename(this.form)">
Choose the file for the Big Banner<br>
<input type="file" name="bigad"><br><p>
Choose the file for Small Banner<br>
<input type="file" name="smallad"><p>
<input type="hidden" name="name" value="">
<input type="hidden" name="nam" value="">
<input type="submit" name="submit" value="Upload">
</form>
<--------------UPLOADBANNER.CFM----------------->
<cffile action="UPLOAD" destination="i:\maxwell\banners\#form.name#" nameconflict="OVERWRITE" filefield="bigad">
<cffile action="UPLOAD" destination="i:\maxwell\banners\#form.nam#"
nameconflict="OVERWRITE" filefield="smallad">