Jump to content

[Solved]Move file on ftp


Kiesp
 Share

Recommended Posts

The title says it all :P

Is there a way to move a file on a ftp server ?

I know i can just download the file and then reupload it to the new location and then delete the original file, but is there a easier, and possibly faster way ? :x

Greets

Kiesp

Edited by Kiesp

http://www.autoitscript.com/forum/index.php?showtopic=69911 <-- Best hacker ever :D

Link to comment
Share on other sites

  • 6 months later...

Nvm.. I found out how to do it. Just use the _ftp_filerename function and then use full paths

_FTP_FileRename($conn,"/place/to/move/from/file.name", "/place/to/move/to/file.name")

hope it helps someone else :)

Edited by Kiesp

http://www.autoitscript.com/forum/index.php?showtopic=69911 <-- Best hacker ever :D

Link to comment
Share on other sites

You should use "rename"

here a sample

ftp> pwd

257 "/data/misc/renametest" is current directory.

ftp> ls

200 PORT command successful.

150 Opening ASCII mode data connection for /bin/ls (14 bytes).

./from

./to

226 Transfer complete. 14 bytes in 0.00 sec. (13.672 Kb/s)

FTP: 14 Bytes empfangen in 0,00Sekunden 14,00KB/s

ftp> ls to

200 PORT command successful.

150 Opening ASCII mode data connection for /bin/ls.

226 Transfer complete. 0 bytes in 0.00 sec. (0.000 Kb/s)

ftp> ls from

200 PORT command successful.

150 Opening ASCII mode data connection for /bin/ls (21 bytes).

from/Testbefore.txt

226 Transfer complete. 21 bytes in 0.00 sec. (20.508 Kb/s)

FTP: 21 Bytes empfangen in 0,00Sekunden 21000,00KB/s

ftp> rename from/Testbefore.txt to/Testafter.txt

350 RNFR Ok. Ready for destination name.

250 Requested file action okay, completed.

ftp> ls to

200 PORT command successful.

150 Opening ASCII mode data connection for /bin/ls (18 bytes).

to/Testafter.txt

226 Transfer complete. 18 bytes in 0.00 sec. (17.578 Kb/s)

FTP: 18 Bytes empfangen in 0,00Sekunden 18000,00KB/s

ftp> ls from

200 PORT command successful.

150 Opening ASCII mode data connection for /bin/ls.

226 Transfer complete. 0 bytes in 0.00 sec. (0.000 Kb/s)

ftp>

Oops ... you where faster

Edited by forumer100

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...