Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <? ob_start(); ?>
- <?php
- $fastdl = "http://domain.org/fastdl/csgo"; // Your fastdl root folder, make sure there is no / on the end.
- $ftp_server = "93.186.198.32"; // The FTP IP for your server, no port // 93.186... ist meine Gameserver IP
- if($_GET['dl']) {
- $dlfile=$_GET['dl'];
- if(!file_exists(substr($dlfile, 1)) && substr($dlfile, -8) == ".dua.bz2") {
- $dldua=substr($dlfile, 1, -4);
- if (file_exists("0")) {
- rename("0", "1");
- } elseif(file_exists("1")) {
- sleep(5);
- header("Location: " . $fastdl . $dlfile);
- exit;
- }
- $conn_id = ftp_connect($ftp_server, "21"); // Default port for FTP, change if needed
- $login_result = ftp_login($conn_id, "****", "****"); // Your server FTP user/pass here.
- ftp_pasv($conn_id, true);
- ftp_chdir($conn_id, "93.186.198.32 port 28015/counterstrike_go/csgo"); // If your home folder when you connect to your server's FTP isnt the base garrysmod folder, navigate to it here. If it is, comment/delete this line.
- ftp_get($conn_id, $dldua, $dldua, FTP_BINARY);
- ftp_close($conn_id);
- $data = file_get_contents($dldua);
- file_put_contents("compress.bzip2://" . substr($dlfile, 1), $data);
- //unlink($dldua); Deletes the .dua after it has been added to the archive, I wouldn't recommend this as sometimes players seem to ask for the .dua rather than the .dua.bz2.
- rename("1", "0");
- header("Location: " . $fastdl . $dlfile);
- exit;
- }
- else {
- header("Location: " . $fastdl . $dlfile);
- }
- } else {
- // This can be modified as you please and will be displayed when someone tries to access this file from their web browser with no parameters specified.
- /*echo "<html>
- <head>
- <title></title>
- </head>
- <body>
- </body>
- </html>";*/
- header("Location: " . "http://quantumroyal.org");
- }
- ?>
- <? ob_end_flush(); ?>
- Quelle: https://facepunch.com/showthread.php?t=1205157
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement