~vcs-imports/clansuite/trunk

« back to all changes in this revision

Viewing changes to uploads/thumbnail.php

  • Committer: paulbr
  • Date: 2011-01-13 19:44:03 UTC
  • Revision ID: paulbr-20110113194403-gwsy005jgfrqyzca
Ajax Test Modul

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
        // This script accepts an ID and looks in the user's session for stored thumbnail data.
 
3
        // It then streams the data to the browser as an image
 
4
        
 
5
        // Work around the Flash Player Cookie Bug
 
6
        if (isset($_POST["PHPSESSID"])) {
 
7
                session_id($_POST["PHPSESSID"]);
 
8
        }
 
9
        
 
10
        session_start();
 
11
        
 
12
        $image_id = isset($_GET["id"]) ? $_GET["id"] : false;
 
13
 
 
14
        if ($image_id === false) {
 
15
                header("HTTP/1.1 500 Internal Server Error");
 
16
                echo "No ID";
 
17
                exit(0);
 
18
        }
 
19
 
 
20
        if (!is_array($_SESSION["file_info"]) || !isset($_SESSION["file_info"][$image_id])) {
 
21
                header("HTTP/1.1 404 Not found");
 
22
                exit(0);
 
23
        }
 
24
 
 
25
        header("Content-type: image/jpeg") ;
 
26
        header("Content-Length: ".strlen($_SESSION["file_info"][$image_id]));
 
27
        echo $_SESSION["file_info"][$image_id];
 
28
        exit(0);
 
29
?>
 
 
b'\\ No newline at end of file'