tibberous Posted February 10, 2008 Share Posted February 10, 2008 I am trying to copy a directory from my ftp server with PHP. Is this possible? Quote Link to comment https://forums.phpfreaks.com/topic/90410-how-can-i-copy-a-directory/ Share on other sites More sharing options...
resago Posted February 10, 2008 Share Posted February 10, 2008 might have timeout issues, but you could do it assuming you have the right permissions. Quote Link to comment https://forums.phpfreaks.com/topic/90410-how-can-i-copy-a-directory/#findComment-463534 Share on other sites More sharing options...
tibberous Posted February 10, 2008 Author Share Posted February 10, 2008 Any idea how? Quote Link to comment https://forums.phpfreaks.com/topic/90410-how-can-i-copy-a-directory/#findComment-463536 Share on other sites More sharing options...
resago Posted February 10, 2008 Share Posted February 10, 2008 file by file. Quote Link to comment https://forums.phpfreaks.com/topic/90410-how-can-i-copy-a-directory/#findComment-463537 Share on other sites More sharing options...
marcus Posted February 10, 2008 Share Posted February 10, 2008 There's a couple examples of how to do it on Google, just search "php copy directory" Quote Link to comment https://forums.phpfreaks.com/topic/90410-how-can-i-copy-a-directory/#findComment-463538 Share on other sites More sharing options...
tibberous Posted February 10, 2008 Author Share Posted February 10, 2008 There's a couple examples of how to do it on Google, just search "php copy directory" No. There isn't. I've been googling, and then yahoo'ing this for damn near 6 hours. And I'm trying to do it through ftp, not just through the file system, so "php copy directory" isn't going to get me shit. Quote Link to comment https://forums.phpfreaks.com/topic/90410-how-can-i-copy-a-directory/#findComment-463544 Share on other sites More sharing options...
blackcell Posted February 11, 2008 Share Posted February 11, 2008 Dude, I don't know if it will work because of security issues. I tried for half a day at work to have files/directories copied from our web server to our file server (two different computers) and it would not have anything to do with it. My boss and I had stabbed and stabbed at it until we came to the conclusion it may not be possible. The thing we did to get around it was setup xampp lite directory on the file server and ran the services from the webserver pc. Therefore file transfers were easy because we were handling them completely on the file server with only one php program being hosted from that pc. That was an odd situation and I don't know if that provides you with any insight on how to get around or solve it but let me know if you find anything. Quote Link to comment https://forums.phpfreaks.com/topic/90410-how-can-i-copy-a-directory/#findComment-463671 Share on other sites More sharing options...
tibberous Posted February 11, 2008 Author Share Posted February 11, 2008 Here's the solution I came up with. It takes the remote folder and saves it to the local hard drive. It's a command line app, so you basically run it like: php get.php domain.com username password It saves all the files in your sites folder/domainname. <?php ?> Quote Link to comment https://forums.phpfreaks.com/topic/90410-how-can-i-copy-a-directory/#findComment-463715 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.