Skip to content
WJunction - Webmaster Forum

How to download from direct urls.

Status
Not open for further replies.
PHP:
<?php 
set_time_limit(0); 
ini_alter("memory_limit", "1024M"); 

function download($link){ 
    return file_get_contents($link); 
} 
function save($string, $nome){ 
    if (file_put_contents($string, $nome)){ 
        return 1; 
    }else{ 
        return 0; 
    } 
} 
if (isset($_POST['submit'])){ 
    $string = download($_POST['link']); 
    $nome = explode("/", $_POST['link']); 
    $nome = end($nome); 
    if (save($string, $nome)) { echo 'Good!'; }else{ echo 'OMG!'; } 
}else{ 
    echo '<form action="download.php" method="post">'; 
    echo '<input type="text" name="link" style="width:100%;height:30px;font-size:20px;"/>'; 
    echo '<input type="submit" name="submit"/>'; 
    echo '</form>'; 
} 
?>

I want to download 100mb 200mb sizes from direct links such as http://site.com/vid.mkv

But this code isnt working!
 

3 comments

Status
Not open for further replies.

About the author

S
New Member · Joined
2
Messages
0
Reactions
1
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom