Server IP : 149.202.105.228 / Your IP : 216.73.216.134 Web Server : Apache System : Linux webm129.cluster030.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : atfycaf ( 116275) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/a/t/f/atfycaf/www/admin/ |
Upload File : |
<?php error_reporting(E_ALL); ini_set("display_errors", 1); header('Content-Type: application/json'); ob_start(); include "globalVars.php"; $myFile = "logPageBG.txt"; $myOutFile = "logPageBGoutput.txt"; $dateOpened = date("g:i:sa l jS F, Y"); $stringData = "OPENED: $dateOpened\n\n"; $fh = fopen($myFile, 'w'); if (isset($_GET["pU"])) { $fileTMP = $SERVER_ROOT ."/admin/files/". $_GET["pU"]; $fileThumb = $SERVER_ROOT ."/admin/files/thumbnail/". $_GET["pU"]; if (file_exists($fileTMP)) { $stringData .= "$fileTMP: OK FILE\n\n"; } else { $stringData .= "$fileTMP: FILE NOT THERE :o(\n\n"; } if (file_exists($fileTMP)) { $tempFile = mt_rand(99999, 99999999); $imageURL = $SERVER_ROOT ."/images/pagesBG/pageBG-temp-". $tempFile .".jpg"; $imageTMP = $SERVER_ROOT ."/images/pagesBG/pageBG-temp.jpg"; $displayURL = $url ."images/pagesBG/pageBG-temp-". $tempFile .".jpg"; $displayTitle = "pageBG-temp-". $tempFile .".jpg"; rename($fileTMP, $imageTMP); $fileTMP = $imageTMP; list($width, $height) = @getimagesize($fileTMP); $imgRatio = $width/$height; if ($width > 3840) { $newWidth = 3840; $newHeight = $newWidth/$imgRatio; $newSize = $newWidth ."x". $newHeight; if ($newHeight < 1080) { $newHeight = 1080; $newWidth = 1080 * $imgRatio; $newSize = $newWidth ."x". $newHeight; } exec("/usr/bin/convert -auto-orient -resize $newSize -strip -limit thread 2 $fileTMP $imageURL"); $stringData .= "\n\n/usr/bin/convert -auto-orient -resize $newSize -strip $fileTMP $imageURL"; } else { $newWidth = $width; $newHeight = $height; copy($fileTMP, $imageURL); } $imageFileSize = filesize($imageURL); $returnJSON = array( "name" => $displayTitle, "size" => $imageFileSize, "url" => $displayURL, "thumbnailUrl" => $displayURL, "deleteUrl" => "photoAlbumUploadDel.php", "deleteType" => "DELETE", "imgWidth" => $newWidth, "imgHeight" => $newHeight ); $stringData .= "\n\nJSON DATA:"; foreach($returnJSON as $jsonK => $jsonData) { $stringData .= "\n$jsonK"; } $stringData .= "\n\n". json_encode($returnJSON); $junk0 = $SERVER_ROOT ."/images/pagesBG/pageBG-temp-". $tempFile ."-0.jpg"; $junk1 = $SERVER_ROOT ."/images/pagesBG/pageBG-temp-". $tempFile ."-1.jpg"; $junk2 = $SERVER_ROOT ."/images/pagesBG/pageBG-temp-". $tempFile ."-2.jpg"; if (file_exists($junk0)) { unlink($junk0); } if (file_exists($junk1)) { unlink($junk1); } if (file_exists($junk2)) { unlink($junk2); } // unlink($fileTMP); unlink($fileThumb); } echo json_encode($returnJSON); } else { $stringData .= "\n\nNO FILE UPLOADED...\n\n"; } //echo $stringData; fwrite($fh, $stringData); fclose($fh); /* $htmlStr = ob_get_contents(); ob_end_clean(); file_put_contents($myOutFile, $htmlStr); */ ?>