Server IP : 149.202.105.228 / Your IP : 216.73.216.18 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/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 = "logBG.txt"; $myOutFile = "logBGoutput.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"]; 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/". $tempFile .".jpg"; $imageTMP = $SERVER_ROOT ."/images/pagesBG/". $tempFile ."-temp.jpg"; $imageTitleURL = $SERVER_ROOT ."/images/pagesBG/". $tempFile ."-title.jpg"; $imageThURL = $SERVER_ROOT ."/images/pagesBG/". $tempFile ."-thumb.jpg"; $displayURL = $url ."images/pagesBG/". $tempFile .".jpg"; $displayThURL = $url ."images/pagesBG/". $tempFile ."-thumb.jpg"; $displayTitle = $tempFile .".jpg"; rename($fileTMP, $imageTMP); $fileTMP = $imageTMP; list($width, $height) = @getimagesize($fileTMP); $imgRatio = $width/$height; $newWidth = $bgWidth; $newHeight = $newWidth/$imgRatio; $newThumbWidth = $imageThumbWidth; $newThumbHeight = $newThumbWidth/$imgRatio; if ($newHeight < $bgHeight) { $newHeight = $bgHeight; $newWidth = $newHeight * $imgRatio; } if ($newThumbHeight < $imageThumbHeight) { $newThumbHeight = $imageThumbHeight; $newThumbWidth = $imageThumbHeight * $imgRatio; } $newSize = $newWidth ."x". $newHeight; $newTitleSize = $bgWidth ."x". $bgTitleHeight ."+0+0"; $newThSize = $newThumbWidth ."x". $newThumbHeight; $croppedSize = $bgWidth ."x". $bgHeight ."+0+0"; $croppedThSize = "200x120+0+0"; exec("/usr/bin/convert -auto-orient -resize $newSize -strip -quality 75 $fileTMP $imageURL"); exec("/usr/bin/convert -resize $newThSize $imageURL $imageThURL"); exec("/usr/bin/convert -gravity Center -crop $newTitleSize $imageURL $imageTitleURL"); exec("/usr/bin/convert -gravity Center -crop $croppedSize $imageURL $imageURL"); exec("/usr/bin/convert -gravity Center -crop $croppedThSize $imageThURL $imageThURL"); $stringData .= "\n\n/usr/bin/convert -auto-orient -resize $newSize -strip -quality 75 $fileTMP $imageURL"; $stringData .= "\n\n/usr/bin/convert -resize $newThSize $imageURL $imageThURL"; $stringData .= "\n\n/usr/bin/convert -gravity Center -crop $newTitleSize $imageURL $imageTitleURL"; $stringData .= "\n\n/usr/bin/convert -gravity Center -crop $croppedSize $imageURL $imageURL"; $stringData .= "\n\n/usr/bin/convert -gravity Center -crop $croppedThSize $imageThURL $imageThURL"; $imageFileSize = filesize($imageURL); $returnJSON = array("name"=>$displayTitle, "size"=>$imageFileSize, "url"=>$displayURL, "thumbnailUrl"=>$displayThURL, "deleteUrl"=>"photoAlbumUploadDel.php", "deleteType"=>"DELETE"); $stringData .= "\n\nJSON DATA:"; foreach($returnJSON as $jsonK => $jsonData) { $stringData .= "\n$jsonK"; } $stringData .= "\n\n". json_encode($returnJSON); $junk0 = $SERVER_ROOT ."/images/pagesBG/". $tempFile ."-0.jpg"; $junk1 = $SERVER_ROOT ."/images/pagesBG/". $tempFile ."-1.jpg"; $junk2 = $SERVER_ROOT ."/images/pagesBG/". $tempFile ."-2.jpg"; if (file_exists($junk0)) { unlink($junk0); } if (file_exists($junk1)) { unlink($junk1); } if (file_exists($junk2)) { unlink($junk2); } unlink($fileTMP); } 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); */ ?>