����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 162.0.232.25 / Your IP : 3.138.105.128 Web Server : LiteSpeed System : Linux premium276.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : kwacuqig ( 988) PHP Version : 8.2.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/kwacuqig/redlighttunes.com/ |
Upload File : |
<?php include './php/connect.php'; error_reporting(0); set_time_limit(0); //force download single if (isset($_GET['sid'])) { $sid = $_GET['sid']; $query = "SELECT `file`,`downloads` FROM `singles` WHERE `id`=$sid"; $result = mysqli_query($conn, $query) or die(mysqli_error($conn)); list($file, $downloads) = mysqli_fetch_array($result); $path = 'singles/audios/' . $file; if (!file_exists($path)) { die("File not found"); } else { header("content-Description: File Transfer"); header("content-type:application:octet-stream;"); header("content-type:application:octetstream;"); header("Content-Disposition: attachment; filename=" . basename($path) . ""); header("Content-Transfer-Encoding: binary"); header("Connection: Keep-Alive"); header("Cache-Control: must-revalidate, post-check=0"); header("Content-Length: " . filesize($path)); header("pragma: public"); readfile($path); //incrementing downloads $increment = ++$downloads; //query to update downloads $query2 = "UPDATE `singles` SET `downloads`=$increment WHERE `id`='$sid'"; if ($result2 = mysqli_query($conn, $query2)) { exit(); } else { die(mysqli_error($conn)); } } } //force download single from an album if (isset($_GET['aid'])) { $aid = $_GET['aid']; $query = "SELECT `music`,`downloads` FROM `album_content` WHERE `sid`='$aid'"; $sql_run = mysqli_query($conn, $query) or die(mysqli_error($conn)); list($music, $downloads) = mysqli_fetch_array($sql_run); $path = 'albums/audios/' . $music; if (!file_exists($path)) { die("File not found"); } else { header("content-Description: File Transfer"); header("content-type:application:octet-stream;"); header("content-type:application:octetstream;"); header("Content-Disposition: attachment; filename=" . basename($path) . ""); header("Content-Transfer-Encoding: binary"); header("Connection: Keep-Alive"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0"); header("Content-length: " . filesize($path)); header("pragma: public"); readfile($path); //incrementing downloads by 1 $increment = ++$downloads; //updating downloads table $query2 = "UPDATE `album_content` SET `downloads`=$increment WHERE `sid`='$aid'"; if ($sql_run2 = mysqli_query($conn, $query2)) { exit(); } else { die(mysqli_error($conn)); } } } //force download whole album in zip format if (isset($_GET['zid'])) { $zid = mysqli_real_escape_string($conn, $_GET['zid']); $sql = "SELECT `artist`,`title`,`image`,`zip_downloads` FROM `albums` WHERE `id`=$zid"; $run = mysqli_query($conn, $sql) or die(mysqli_error($conn)); list($artist, $title, $image, $zip_downloads) = mysqli_fetch_array($run); $increment=++$zip_downloads; if (!empty($zid)) { $sql2 = "SELECT * FROM `albums`,`album_content` WHERE `albums`.`id`=`album_content`.`aid` AND `albums`.`id`=$zid ORDER BY `album_content`.`sid` ASC"; $sql3="UPDATE `albums` SET `zip_downloads`=$increment"; $run2=mysqli_query($conn,$sql2) or die(mysqli_error($conn)); $run3=mysqli_query($conn,$sql3) or die(mysqli_error($conn)); } else { ?> <script type="text/javascript"> alert('Incomplete'); </script> <?php } //creating counter and initializing to 1 $count = 1; //name of the zip file $zipname = './zip/' . $title . '.zip'; $zipname = str_replace(' ', '-', $zipname); if (file_exists($zipname)) { header("location:$zipname"); // echo "<a href=\"$zipname\" download></a>"; } else { //accessing ZipArchive class $zip = new ZipArchive; //opening the zip file i.e album.zip $zip->open($zipname, ZipArchive::CREATE); while ($row = mysqli_fetch_array($run2)) { $id = $row['sid']; $album_path = 'albums/audios/' . $row['music']; $music_title = $row['music_title']; $music_titleurl = str_replace(' ', '-', $row['music_title']); //adding each file path to album.zip $zip->addFile($album_path, $count . ' ' . $row['music_title'] . '.mp3'); $count++; } //adding an image to album.zip $zip->addFile('albums/covers/' . $image, 'Cover.jpg'); //closing album.zip $zip->close(); //force download header("location:$zipname"); } }