Anonymous 3D Imageboard http://cyberia.digital/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
717B

  1. <?php
  2. //Load the DB
  3. require_once "../php/Utils/Constants.php";
  4. $uploaddir = '../php/'.Constants::CONST_IMAGE_UPLOAD_FOLDER.'/';
  5. use Lazer\Classes\Database as Lazer;
  6. define('LAZER_DATA_PATH', '../php/'.realpath(dirname(__FILE__)).'/'.Constants::CONST_DB_FOLDER.'/');
  7. $name = $_GET['name']; // Assuming the file name is in the URL for this example
  8. $parsed = explode("_",$name);
  9. if(count($parsed) != 2) return;
  10. $mapKey = $parsed[0].'/';
  11. $name = $parsed[1];
  12. $ext = pathinfo($name)['extension'];
  13. $mimeType = 'image/'.$ext;
  14. $handle = fopen($uploaddir.$mapKey.$name , "rb");
  15. $contents = fread($handle, filesize($uploaddir.$mapKey.$name ));
  16. fclose($handle);
  17. header("content-type: image/".$ext);
  18. echo $contents;
  19. ?>