imanewbe Posted March 24, 2011 Share Posted March 24, 2011 Hey. I am wanting to move a couple of files from my current server to another. If i am uploading the file this is fine but if it is already on the server then im not sure how to move it. When uploading I can just use ftp_put($conn_id, $destination_file, $myFile, FTP_BINARY); What i need to do is figure out how to get a hold of the file and store it in $myFile then this would work fine. Is this possible? Cheers Link to comment https://forums.phpfreaks.com/topic/231636-moving-file-from-current-server-another-server/ Share on other sites More sharing options...
btherl Posted March 25, 2011 Share Posted March 25, 2011 Do you want to move a file from one server to anther? I would recommend downloading it and then uploading it again. Link to comment https://forums.phpfreaks.com/topic/231636-moving-file-from-current-server-another-server/#findComment-1192010 Share on other sites More sharing options...
imanewbe Posted March 25, 2011 Author Share Posted March 25, 2011 What i want to do is copy the file to 13 servers. this is very time consuming if i have to manually connect to all 13 servers then upload the file. I want to run a script that copies it to all servers. Link to comment https://forums.phpfreaks.com/topic/231636-moving-file-from-current-server-another-server/#findComment-1192096 Share on other sites More sharing options...
monkeytooth Posted March 25, 2011 Share Posted March 25, 2011 if its the same file time and time again. it might be easier to setup a CRON, and then on each of the other servers do something similar to what your doing now but intead of put, use get Link to comment https://forums.phpfreaks.com/topic/231636-moving-file-from-current-server-another-server/#findComment-1192099 Share on other sites More sharing options...
imanewbe Posted March 25, 2011 Author Share Posted March 25, 2011 Its not the same file again and again. It is multiple files multiple times. Link to comment https://forums.phpfreaks.com/topic/231636-moving-file-from-current-server-another-server/#findComment-1192100 Share on other sites More sharing options...
monkeytooth Posted March 25, 2011 Share Posted March 25, 2011 I know it costs a little money, but there are FTP programs that have snyc options to sync multiple locations from one server to the other, or from one local point to multiple remote points, that could be an option too.. not exactly sure what your doing or why.. so just throwing random ideas out. Link to comment https://forums.phpfreaks.com/topic/231636-moving-file-from-current-server-another-server/#findComment-1192103 Share on other sites More sharing options...
imanewbe Posted March 25, 2011 Author Share Posted March 25, 2011 What i want to do is move a file from one server to another. Link to comment https://forums.phpfreaks.com/topic/231636-moving-file-from-current-server-another-server/#findComment-1192104 Share on other sites More sharing options...
imanewbe Posted March 28, 2011 Author Share Posted March 28, 2011 if its the same file time and time again. it might be easier to setup a CRON, and then on each of the other servers do something similar to what your doing now but intead of put, use get How would i be able to do this for say a whole folder of images. Link to comment https://forums.phpfreaks.com/topic/231636-moving-file-from-current-server-another-server/#findComment-1193403 Share on other sites More sharing options...
btherl Posted March 28, 2011 Share Posted March 28, 2011 You could have your script use readdir() or glob() to look at each file in turn, and then connect to each ftp server in turn, uploading all the files. That seems like a logical approach to me. Link to comment https://forums.phpfreaks.com/topic/231636-moving-file-from-current-server-another-server/#findComment-1193447 Share on other sites More sharing options...
imanewbe Posted March 28, 2011 Author Share Posted March 28, 2011 cheers. Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/231636-moving-file-from-current-server-another-server/#findComment-1193448 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.