File:  [mozdev] / savefileto / www / test / file_png_redirect_cd.php
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Sun Feb 7 09:40:00 2010 UTC (10 years, 3 months ago) by atte
Branches: MAIN
CVS tags: HEAD
added redirect with no content disposition test

    1: <?php
    2: $file = "file.png";
    3: $contentType = "image/png";
    4: 
    5: if (! isset($_GET["redirected"]))
    6: {
    7:     $parsed_url = parse_url($_SERVER["REQUEST_URI"]);
    8:     header("Location: http://".$_SERVER["SERVER_NAME"].$parsed_url["path"]."?redirected");
    9:     exit;
   10: }
   11: 
   12: header("Content-Length: " . filesize($file));
   13: header("Content-Type: " . $contentType);
   14: header("Content-Disposition: inline; filename=\"" . $file . "\"");
   15: readfile($file);
   16: ?>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>