Get File PHP Script

Get File PHP Script

Here is a simple PHP script that will allow you to download a file (e.g. http://mywebsite.com/file.zip) from a certain server to your server. Basically it’s like transferring the remote file to your own server, without having you to download the file and upload it over again to your own.

It’s kinda similar to x10media’s xTransloader Script, although it uses the alternate or different php function. But this should work, I’ve tested it before on my experiment arcade site, i used the script to transfer the flash game packs (which sizes are around 100mb each archive) which came from another server to my server.

I hope you can find this useful.

Instructions on how to use it are commented on the php file… Enjoy.

Download the file (compressed) – php.getfile.zip

Sorry, No related posts found.

Promote

If you enjoyed reading this article, help let the world know about it by sharing it on your favourite social networking site

Comments

Very neat script. Haven’t tested it yet, though.

And, I suggest making the two strings a variable instead of just ‘directing’ it. So that you can have a user-friendly copier. Haha.

Like, you can make a form (which has an action ‘GET’ and directs to ‘getfile.php’) stating the URL of the file from another server and where to put it. So, you can make variables:

$urlfile = $_GET["the_url"]; $dest = $_GET["dest"];

Then call it out in the copy function:

<?php
if(!copy($urlfile, $dest))
{
echo(" GET STATUS: ERROR!Sorry, Failed to copy file.");
}
;
?>

Well, I’m still learning PHP so I don’t know security stuffs. But I think you can cut bad characters through the trim() and preg_match() functions. :)

Hoping for an improved one. :))

Say Something