I only purchased a web domain yesterday(cryptum.internet) and that i plan to upload some files into it. My issue is I do not have a very good PHP5 download script. Among the finest an easy script which will save the file towards the customers download folder. The files are situated around the websites ftp server. Here's what I've to date-
<?php $conn = ftp_connect("ftp://email@example.com") or die("Couldn't connect") ftp_login($conn,"username","password") //download script goes here ftp_close($conn) ?>
<?php //... //download script goes here ftp_get ($conn, '/destination/on/my/hardDrive', '/file/to/download') //... ?>
and you could utilize php-curl rather...
Another very elegant solution which uses the effective stream options that come with PHP:
<?php $ftp_server = 'ftp://username:firstname.lastname@example.org/' $remote_file = 'user/directory/file' $local_file = '/path/to/the/local/file' file_put_contents($local_file, file_get_contents($ftp_server.$destination_file))