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

query based on 2 conditions
I want to select if the doc_type is either s OR f but this doesn't work:

Code: [Select]$query

Server side $_SESSION
how does one keep the session completely server side. no cookies to the browser at all. i need this

Multiple Options for a Single Page
For this example I want to use the Handlers option which is under Fed Admin and all the related codi

How to limit the calls to an API
Hello, in my simple script I call an api which effectively involves me getting an xml file.

H

Check something, wait, check again, do something!
Hi guys.

I wonder if someone can help me with this.

Basically, what I want to do is (

Looping Problem
I've got a client that has a database with about 200 events at any given time. I'm trying to loop t

Option box to change variable
Hello, i need help by making a script!

I need to write a file with option box, so a dropdown

php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from th

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

Image upload - determine folder
I have an upload script that may be accessed from different directories. Problem is, the script is m

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