Skip to content

Commit

Permalink
Added Content-disposition header to help some browsers suggest the right
Browse files Browse the repository at this point in the history
filename when saving pictures and files.
  • Loading branch information
martin committed Sep 2, 2002
1 parent 0eae804 commit 5be2f47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion file.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion user/pix.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 5be2f47

Please sign in to comment.