Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
authored September 02, 2002

Showing 2 changed files with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 3  file.php
  2. 3  user/pix.php
3  file.php
@@ -39,7 +39,8 @@
39 39
         header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
40 40
         header("Cache-control: max_age = $lifetime"); // a day
41 41
         header("Pragma: ");
42  
-        header("Content-Length: ".filesize($pathname));
  42
+        header("Content-disposition: inline; filename=$filename");
  43
+        header("Content-length: ".filesize($pathname));
43 44
         header("Content-type: $mimetype");
44 45
         readfile("$pathname");
45 46
     } else {
3  user/pix.php
@@ -31,7 +31,8 @@
31 31
     header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
32 32
     header("Cache-control: max_age = $lifetime"); // a day
33 33
     header("Pragma: ");
34  
-    header("Content-Length: ".filesize($pathname));
  34
+    header("Content-disposition: inline; filename=$image");
  35
+    header("Content-length: ".filesize($pathname));
35 36
     header("Content-type: image/jpeg");
36 37
     readfile("$pathname");
37 38
 

0 notes on commit 5be2f47

Please sign in to comment.
Something went wrong with that request. Please try again.