To begin with, I'm not sure if this sounds like where I must request this so I'll rely on the other staff to maneuver it if necessary.

I've got a Linux PHP website hosting account on GoDaddy.

When I must upload personal files, I normally use FTP, whether client or even the host's file manager.

However, when the file is a which i've to download from another website, I'd prefer basically could "download" it straight to my hosting account this is because I am in Mauritius and our connection is probably the slowest on the planet. And So I would rather while using high (I am just presuming it's greater) bandwidth from the host to ensure that transfers go more rapidly.

So, my real question is: does anybody of you've got a solution (PHP script, Java applet, or anything) which i can use to accomplish this?

Thanks ahead of time,

Yusuf

To begin this can be a burglar risk in your server.

Next, here's little untested code:

<?php

echo 'get file...';

$data=file_get_contents('http://...target-url...');

if($data===false)die('Failed getting file.');

echo 'saving file...';

$succ=file_put_contents('...target-file...',$data);

echo $succ ? 'Success' : 'Failed saving file';

?>

Functional script (put in file "lower.php" inside your web root):

<?php
    echo 'get file...';
    if(!isset($_REQUEST['from'])die('Fail: Parameter "from" not set.');
    if(!isset($_REQUEST['to'])die('Fail: Parameter "to" not set.');
    $data=file_get_contents($_REQUEST['from']);
    if($data===false)die('Failed getting file.');
    echo 'saving file...';
    $succ=file_put_contents($_REQUEST['to'],$data);
    echo $succ ? 'Success' : 'Failed saving file';
?>

Usage (run it in from internet browser):

http://yoursite.com/down.php?from=http://yourothersite.com/file-content.txt&to=/var/www/public_html/target.txt

WARNING: Make certain you remove script after use, it's a grave security problem.

Wget I apply it installing wordpress right to a server:

 # Download the title page of example.com to a file
 # named "index.html". 
 wget http://www.example.com/
 # Download Wget's source code from the GNU ftp site. wget
 ftp://ftp.gnu.org/pub/gnu/wget/wget-latest.tar.gz

The example come from the hyperlink above.