Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Content-disposition header to help some browsers suggest the right

filename when saving pictures and files.
  • Loading branch information...
commit 5be2f47cf4f10ac30afcdc54f0b804bf80be570c 1 parent 0eae804
martin authored
Showing with 4 additions and 2 deletions.
  1. +2 −1  file.php
  2. +2 −1  user/pix.php
3  file.php
View
@@ -39,7 +39,8 @@
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
header("Cache-control: max_age = $lifetime"); // a day
header("Pragma: ");
- header("Content-Length: ".filesize($pathname));
+ header("Content-disposition: inline; filename=$filename");
+ header("Content-length: ".filesize($pathname));
header("Content-type: $mimetype");
readfile("$pathname");
} else {
3  user/pix.php
View
@@ -31,7 +31,8 @@
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
header("Cache-control: max_age = $lifetime"); // a day
header("Pragma: ");
- header("Content-Length: ".filesize($pathname));
+ header("Content-disposition: inline; filename=$image");
+ header("Content-length: ".filesize($pathname));
header("Content-type: image/jpeg");
readfile("$pathname");
Please sign in to comment.
Something went wrong with that request. Please try again.