download directory onto C drive


Posted on 16th Feb 2014 07:03 pm by admin

I am attempting (if this is possible) to write a routine to automatically dump the contents of a directory on the server into a directory on the local C drive.

I started out like this :

Did you know?Explore Trending and Topic pages for more stories like this.
Code: $conn_id = ftp_connect($myurl);
$login_successful = ftp_login($conn_id, $id, $password);
if ($login_successful) {
echo '<H2>Download underway ...'.PHP_EOL;
$contents = ftp_nlist($conn_id, $the_appropriate_path);
foreach ($contents as $file) {
echo $file.'<BR>'.PHP_EOL;
}



And this does exactly as expected, it lists all the files in the directory on the server !


Now I have to dump them onto my C drive. Is this possible using ftp_get, or do I have to use some other way ?
No comments posted yet

Your Answer:

Login to answer
169 Like 27 Dislike
Previous forums Next forums
Other forums

File upload issues
Hi Guys,

Can anyone see any issues with this code:
Code: [Select]$setImage= 'productimages

Troubles with a spider class
I am building a spider that will crawl through random whitepages (eg. anywho.com, switchboard.com, w

links using header()
Hi All

I'm not sure where to ask for help on this but I hope someone can offer some. I'm at

Problem with the Update command used with a sqldataadapter
I'm connected to a database on an SQL Server and I'm using a sqldataadapter, sqlconnection, sqldatas

form problem
below in the form action, i've put "test.php?w=$sw&h=$sh" but when i input the for

Undefined Variable: PHP_SELF, pls help
Hi,

Im a newbie on PHP / MySQL programming and Im running a script to search one field on my

'210010106140040100' == '210010106140040101'
Debugging this simple line of a PHP script

Code: if($a == $b){ }
I've found that with val

mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscr

Problem with HTTP Caching...?
Hi there, im trying to implement caching. But it doesn't always work.
I post it here because ther

php problem?
I don't think I'm stupid, but maybe I am.

I am working on a sit for a friend I am try to put

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash