views:

112

answers:

4

Hi guys ,

I own a website and I wonder if there is a script that get files for me from other links on the net a load it to my server

I will explain more

I found a file with a size of 400 mb i want to host it on my server the normal way i used is to download the file to my pc then upload it to my server but is there a script or a way to transfer and host the file directly without downloading it.

:-) coz i have an unlimited space on the net and i want to use it

thanx in advance

+1  A: 

wget from your server.

Assuming you have a *nix host and ssh of course. My answer should work on any host that supports PHP.
Unkwntech
Actually, there's wget for Windows and many other platforms as well.
Moshe
A: 

If you can remote into your server you could just navigate to the web page containing your download from within the server and save it directly to the server that way.

Neitherman
+1  A: 

As long as you have PHP use:

<?php
$remotefh = fopen('http://domain.tld/path/to/file.ext', 'r'); 
$localfh = fopen('local/file.ext', 'w');
while(!feof($remotefh)) 
 {
    fwrite($localfh, fread($remotefh, '4096'));
 }
fclose($remotefh);
fclose($localfh);
?>
Unkwntech
You may have to add ini_set('max_execution_time', $time); where $time is a large number representing # of seconds, this would go right below <?php
Unkwntech
I didnt get can you guide me step by step if possibleI host with bluehost Co.
Also keep in mind that some hosts do not allow fopen(..) to open files on remote sites. I was with a cheap host earlier, which changed this policy out of the blue without informing their customers. It might happen if they feel you abuse it (which they might in this case). Good luck!
DeletedAccount
A: 

I think FTP protocol supports server to server transfer.

PhiLho
Many servers block this, I know I do.
Unkwntech