Created
December 6, 2017 12:45
-
-
Save alfredotranchedone/c3b8bb74f239954e4402329a31094e95 to your computer and use it in GitHub Desktop.
Get file via exec(wget)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Upload file from URL</title> | |
</head> | |
<body> | |
<?php | |
$BASE_URL = strtok($_SERVER['REQUEST_URI'],'?'); | |
if (isset($_POST['url'])){ | |
$url = $_POST['url']; | |
echo "Transferring file: {$url}<br>"; | |
exec("wget {$url}"); | |
} | |
?> | |
<form name='upload' method='post' action="<?php echo $BASE_URL; ?>"> | |
<input type='text' id='url' name='url' size='128' /><br> | |
<input type="submit" value="Upload"> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment