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

Certain files upload, while others do not
I want to read the data from an uploaded file. Not sure why, but it only uploads for certain files.

some questions
Hello,

I am looking for the answers for following questions:

1) Does PHP support overl

php mailer
How can i send a mail to large no, say 50,000 reciepients using [color=#0000FF]php mailer[/color]

Help on code output
My CODE:

Code: [Select] echo "<phone>".$line["phone"].&qu

PHP Display Telephone Number On Referrer
I have used the php below to show a different telephone number in the header of the site depending u

Problem with PHP code- simple contact form
Hi Folks,
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a co

Multiple submit forms inside a mysql array page
Hi all,

Im having trouble to get the beneath script to work the thing i can't seem to get wor

Need help to modify php ELSE code
I'm trying to find a way to have the php code display a message if there is no inventory listed in t

Facebook status update API
Hello,

So, I'm trying to create my first Facebook application with PHP.

Basic ideas fo

Transferring session variables into MySQL
I am trying to transfer $_SESSION variables into MySQL. However there is an error in my MySQL statem

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