Moving files

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have an FTP process where my files are download to dirve x:\ftpdownloads I
then want to move those files from x:\ftpdownloads to c:\temp.

I've tried the copy function without any luck.


Re: Moving files

Do you have the rights to write on C:\temp ? Do your process have this
right ?

The ftp_get function propose to give the loacl path where to put the
distant file, can't you directly indicate C:\temp ?

what code do you use ? what machines ? what  OS ?

need more info.

Re: Moving files

Quoted text here. Click to load it
Yes, I do have rights to c:\temp and the OS is Windows XP Professional

Here's the code:
   $local_file = 'c:\temp\test.sqr';
   $server_file = 'sirs_std_bmkdetl.sqr';

 if (ftp_get($con, $local_file, $server_file, FTP_BINARY)) {
     echo "Successfully written to $local_file\n";
 } else {
     echo "There was a problem\n";

I also tried without any luck.

 $file = 'test.sqr';
 $newfile = 'c:\temp\copytest.sqr';
 if (!copy($file, $newfile)) {
     echo "failed to copy $file...\n";
    else {
     echo "Copy is OKJ $file...\n";

Re: Moving files

Can you do an fwrite on c:\temp\test.sqr ?

Is   sirs_std_bmkdetl.sqr  really downloaded ?

Can you read it ?

can yo try a fwrite/fopen/file_get_contents combination :

        fopen("c:\temp\test.sqr", a+)
        file_get_contents ("x:\ftpdownloads\sirs_std_bmkdetl.sqr")


Site Timeline