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 :

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

Form File Upload
I've read through tons of resources and tutorials and as far as I can tell, my code is accurate, but

Simple Question
I know this is a simple question, that if I knew what it was technically called i could probably loo

I need help on this PHP code
Hi everybody, I made some kind of mistake while editing the code below. As you see, at the 3 row my

PHP MySQL and DATE
Hi everyone

I have a databse and in one of the columns I have date values such as 2009-March-

Sufficient protection from bad input?
I am writing a simple script to let people upload 'pages' of their own content, be it simply a few b

How to extract/download content from HTTPS page?
Hello to all the Members of this forum, Im Shoiab, A novice programmer in php.. for my first job I h

How to get all server headers like Live http Headers does
Hey all, like many of you I use the Firefox addon "Live http Headers". I'm trying to write

show the direct link into href
I want to display link on the page. i am fetching the data(URL) from database,actually before that i

date function help
i need help with date function

Code: [Select]<!DOCTYPE HTML PUBLIC "-//W3C//DTD H

Why is this query failing?
Why is this not working?
$query = "SELECT * FROM `users` WHERE `userid` = " . $USERID

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