Permalink
Browse files

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

filename when saving pictures and files.
  • Loading branch information...
1 parent 0eae804 commit 5be2f47cf4f10ac30afcdc54f0b804bf80be570c martin committed Sep 2, 2002
Showing with 4 additions and 2 deletions.
  1. +2 −1 file.php
  2. +2 −1 user/pix.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 {
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");

0 comments on commit 5be2f47

Please sign in to comment.