index.php 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. if (!empty($_REQUEST['path'])) {
  3. $path = $_REQUEST['path'];
  4. if (is_readable($path) && !empty($_REQUEST['raw'])) {
  5. header('content-type: image/jpeg');
  6. print file_get_contents($path);
  7. exit;
  8. }
  9. }
  10. else {
  11. die('File not found');
  12. }
  13. ?>
  14. <!DOCTYPE html>
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  18. <title>fotorama</title>
  19. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  20. <link href="//cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.2/fotorama.css" rel="stylesheet">
  21. <script src="//cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.2/fotorama.js"></script>
  22. </head>
  23. <body>
  24. <div style="background-color: #eee; /*display: inline-block; vertical-align: middle;*/ height: 100%; text-align: center; /*position: absolute; /*top: 50%; left: 50%; margin-top: -50px; margin-left: -50px; /*data-maxheight="100%" data-maxwidth="100%" */"
  25. class="fotoram" data-fit="scaledown" data-allowfullscreen="true" data-nav="false">
  26. <img src="/view/file/?path=<?=$path?>&raw=true" style="background: #3A6F9A; vertical-align: middle; /*max-height: 25px; max-width: 160px;*/" />
  27. </div>
  28. </body>
  29. </html>