I need to use CFFILE move action to move 600 or more files
from one folder to another in different server.
1. in the fromPath do I have to include the name of file to
moved?
2. if there are more than 600 files, how to do this without
slowing down the process.
<cffile action="MOVE" source="#FromPath#"
destination="#ToPath#"> >> this may work for moving one
file
how to move more than 600 different files?
If they are separate servers CFFILE likely will not work
because it interacts with the local directories, not remote
directories.
If you have the drives properly mapped, it may work, but you
may want to try doing something with FTP.
JMO since I don;t know the exact setup of your service.
If both servers are CF servers and running CF8, you could zip
up all the files, send the one file to the other location, then
unzip the files on the new machine.
I'm currently still in development process, I would think it
will be within the same server especially when I look at similar
project.
Assuming it is within the same server, I did the following
(see blow). It works for smaller files (below 300) but when I
tested with 800 files I got time out error (see below). Can anyone
help with a better solution?
alecken wrote:
> Can anyone help with a better solution?
Increase the timeout value from the default, either globally
in the
administrator or specifically in this template with the
<cfsetting ...> tag.
This kind of heavy OS manipulation is not really CF's strong
suite. If
performance is a concern you may want to look into tapping a
language
closer to the OS such as C++ or Java. A routine properly
written with
either could be easily tapped with a ColdFusion template to
integrate
with a larger CF application if required.
alecken wrote:
> I need to use CFFILE move action to move 600 or more
files from one folder to
> another in different server.
> 1. in the fromPath do I have to include the name of file
to moved?
> 2. if there are more than 600 files, how to do this
without slowing down the
> process.
>
> <cffile action="MOVE" source="#FromPath#"
destination="#ToPath#"> >> this
> may work for moving one file
> how to move more than 600 different files?
>
<cffile...> by itself is not going to do this for you.
You will need to
combine it with <cfdirectory...> and some type of loop
such as
<cfoutput> or <cfloop>.
SafariTECH wrote:
> If they are separate servers CFFILE likely will not
work because it
interacts
> with the local directories, not remote directories.
Actually <cffile...> and <cfdirectory...> can
work wit remote
directories. As long as both systems are on a well defined
network and
the CF server is running as a user with the required
permissions to
access the remote computer over the network.