• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

Copy Files from Network Drive to Local PC using CFFILE (?)

Hi,
I need to transfer files to local pc's on demand. This is used to keep some remote computers, and laptops, updated with critical data for use in the field. The concept is that the field crew brings it's laptop into the building and connects to the network. Then they navigate to a very simple web page with a "Click Me to update your files" button. The paths to both the source and destination files are maintained in a sql table, and I intended to use a cfquery in a cfloop around a cffile command to copy files from a network location to their C drive.  Here is a sample of the data involved....

*******************************************************
SQL Table GIS_PWUpdateFiles:

TransferID          1
Source                \\cobdata7\d$\dept\cddroot\cdd1\gis-cov\cob\boundary\bv_fill.*                                  
Destination           c:\gisdata\cob\          
Workgroup          PW

*******************************************************
The page that starts up when they click the button:

<cfquery datasource="GIS_CoreData17" name="getFiles">
      Select source, destination, workgroup
      from dbo.GIS_PWUpdateFiles
      Where workgroup like 'PW%'
      Order by TransferID
</cfquery>
      
Stand by... Files are being copied...<br /><br />

<cfoutput query="getFiles" > 

          <cffile action="copy"
      source = "#source#"
      destination = "#destination#">

#source#. . . was copied to . . . #destination#<br />

</cfoutput>
***************************************************
For some reason, this just doesn't work. I have tried multiple styles of entering the path/file names for both source, and destination but it still croaks with an error -

Either something like ...
===========================================================================
[Attribute validation error for tag CFFILE - The value of the attribute destination, which is currently "c:\gisdata\cob\", is invalid. ]
===========================================================================

or something like...
======================================================================
[An exception occurred when performing a file operation copy on files \\cobdata7\d$\dept\cddroot\cdd1\gis-cov\cob\boundary\bv_fill.* and c:\gisdata\cob.
 
The cause of this exception was: java.io.FileNotFoundException: \\cobdata7\d$\dept\cddroot\cdd1\gis-cov\cob\boundary\bv_fill.* (Access is denied).]  
======================================================================

This is a pretty simple file copy which I want to do through a web interface rather than a batch file. I don't want to specify all the exact file names specifically and would like to use *.* whenever possible. I am open to other solutions besides CF (asp?), but I like CF and would like figure out how to use it to solve this, if possible.

Can anyone help on this?

0
Bauerchick
Asked:
Bauerchick
  • 3
  • 3
1 Solution
 
BauerchickAuthor Commented:
I guess Friday afternoon is not the best time to post a question....

No worries, I will be back at it on Monday and will check to see all the wonderful ideas the experts have proposed...

Hope you all have a great weekend!

0
 
jtreherCommented:
Hi Farmer Chick, cffile cannot interact with the user's computer in this manner. the destination is the path on the coldfusion server. Now about the idea of using a network map as in: destination= \\theLaptopNameOfUser\C$\blah\blahsub\ might be possible, but that person would have to have that folder set up with permissions to the coldfusion server and you would have to get the computer name which would be possible by creating custom hyperlinks with some security checks. I'm not even sure that network access would work as I've never tried.

You would probably need to write a java applet to handle this.
0
 
BauerchickAuthor Commented:
Geez,
Maybe I should just use a .bat file and cflocation...? Seems a lot simpler.
Kind of crazy that we can't perform a very simple operation like this using the web... and have to resore to DOS to accomplish it. Good thing I learned DOS in the old days.

I'll leave this open a little while longer in hopes that someone will have a brilliant idea.

Bauerchick
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
jtreherCommented:
Well, you must not forget that you are dealing with an Internet application. There are certain security steps taken so this very thing doesn't happen. Sure there are holes, but they are often filled. Would you want any  coldfusion programmer to be able to easily load files on your computer? Just remember that coldfusion cannot interact with the client. It is not what coldfusion or any other web language is meant to do.

0
 
BauerchickAuthor Commented:
Do you have another way to do this beside DOS using a web page to trigger it?
0
 
jtreherCommented:
I can't think of anything other than using some of the windows networking tools or a login script. This is definitely not something to be doing over the web.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now