Moving files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • paddy_nyr

    #1

    Moving files

    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.

    Thanks



  • romain.jouin@gmail.com

    #2
    Re: Moving files

    hi,
    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.
    JR.

    Comment

    • paddy_nyr

      #3
      Re: Moving files


      <romain.jouin@g mail.com> wrote in message
      news:1126719265 .188252.37560@o 13g2000cwo.goog legroups.com...[color=blue]
      > hi,
      > 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.
      > JR.
      >[/color]
      Yes, I do have rights to c:\temp and the OS is Windows XP Professional

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


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

      I also tried without any luck.

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




      Comment

      • romain.jouin@gmail.com

        #4
        Re: Moving files

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

        Is sirs_std_bmkdet l.sqr really downloaded ?

        Can you read it ?

        can yo try a fwrite/fopen/file_get_conten ts combination :

        fwrite
        (
        fopen("c:\temp\ test.sqr", a+)
        ,
        file_get_conten ts ("x:\ftpdownloa ds\sirs_std_bmk detl.sqr")
        )

        ?

        Comment

        Working...