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

[function.file]: failed to open stream: No such file or directory
Okay I wrote this little script to upload a csv file that is located on my webhosts server to a mysq

recrawling
Can anyone suggest me how may i know a page is updated before it is being downloaded, so that i can

Simple code help with redirects
I am trying to figure out a redirect script that detects if the browser is IE 7 and if it does, redi

How to restrict the display of report variants
Hello All,

I want t know how to restrict the display of report variants.
I mean, whe

Problem executing bash script using shell_exec
Hi there,
I created a bash script file using following code to convert doc documents to pdf using

Working with Global Variables
hi, I'm not really sure why the following code is returning a "Call to a member function getBan

Using system() and bringing back the results
I am aware that you can use system() within PHP to execute system commands, but I was wondering if t

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

insert quotes
Hi,

I have an output like this:
Code: john,18,Cancer
How can I change this to
Code:

need help in php variable
i have a php variable on one page
Code: [Select]$lastId = mysql_insert_id($db);
echo $lastId;<

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