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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFILE - Serious

Status
Not open for further replies.

saurabh

Programmer
Jul 10, 2000
27
IN
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=&quot;multipart/form-data&quot; name=&quot;banr&quot; method=&quot;post&quot; action=&quot;uploadbanner.cfm&quot; onsubmit=&quot;getrealfilename(this.form)&quot;>
Choose the file for the Big Banner<br>
<input type=&quot;file&quot; name=&quot;bigad&quot;><br><p>
Choose the file for Small Banner<br>
<input type=&quot;file&quot; name=&quot;smallad&quot;><p>

<input type=&quot;hidden&quot; name=&quot;name&quot; value=&quot;&quot;>
<input type=&quot;hidden&quot; name=&quot;nam&quot; value=&quot;&quot;>
<input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Upload&quot;>
</form>

<--------------UPLOADBANNER.CFM----------------->
<cffile action=&quot;UPLOAD&quot; destination=&quot;i:\maxwell\banners\#form.name#&quot; nameconflict=&quot;OVERWRITE&quot; filefield=&quot;bigad&quot;>

<cffile action=&quot;UPLOAD&quot; destination=&quot;i:\maxwell\banners\#form.nam#&quot;
nameconflict=&quot;OVERWRITE&quot; filefield=&quot;smallad&quot;>
 
Did you read the error? It gives you the exact reason in plain english.

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.


I couldn't explain it any better myself.
Check the path and make sure your host has CFFILE enabled.

 
Another suggestion... you don't need Javascript to get the filename. All you need to do is reference File.ClientFile once the file has been uploaded in the code with the <Cffile> tag. [sig]<p> <br><a href=mailto:aberman@thebiz.net>aberman@thebiz.net</a><br><a href= > </a><br>Database web programmer and developer, fueled by peach snapple and mochas.[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top