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

cfile and cfcontent tags problem

Status
Not open for further replies.

vam123

Programmer
Oct 27, 2001
2
US
<CFFILE ACTION=&quot;Copy&quot;
SOURCE=&quot;\\machine90\sss\shi.txt&quot;
DESTINATION=&quot;\\mecser\e\&quot;
>


<CFCONTENT TYPE=&quot;text/html&quot;
FILE=&quot;\\mecser\e\shi.txt&quot; DELETEFILE=&quot;No&quot;>


i am trying to copy a file from a remote machine to the server and then download the file from the server to the local machine.

i am using the above code. destination drive is on server. i am getting the below error.

Error processing CFFILE

Unable to copy file '\\machine90\sss\shi.txt' to path '\\mecser\e\shi.txt'. Error: The network path was not found. (error 53).

The error occurred while processing an element with a general identifier of (CFFILE), occupying document position (14:1) to (17:5).

what might be the reason, do i need to map any drives, do i have to map the local drive from the server or the destination drive on the server from the local machine?

please help


 
I think cffile needs to have a local or mapped drive, as opposed to a network path. Here's what I have done to circumvent the problem:

<cfif #parameterexists(form.xfile)#>

<CFSET thisDirectory= GetDirectoryFromPath(#form.xfile#)>
<CFSET thisFile= GetFileFromPath(#form.xfile#)>

<cffile action=&quot;write&quot; file=&quot;d:\copyfile2.bat&quot; output=&quot;copy #thisDirectory##thisFile# d:\InetPub\ >> d:\copyrslt2.txt&quot;>

Then I execute the file I just wrote:

<cfexecute name=&quot;d:\copyfile2.bat&quot;></cfexecute>

Here's an example of a typical &quot;copyfile2.bat&quot;:

copy \\orion\bbartel\C125.xls d:\InetPub\ >> d:\copyrslt2.txt

John Hoarty
jhoarty@quickestore.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top