Permalink
Browse files

Dedicated to tau: make image downloads not suck.

Use proper mimetype for jpg's.
Pass Content-Disposition: with the file's real filename.
  • Loading branch information...
1 parent 2f24710 commit 43e7b3d82f037a207592874028526602c4ec6e85 @sofar committed Oct 15, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 image.php
View
@@ -81,7 +81,7 @@ function pass_file_and_exit($file) {
case 'jpg':
case 'jpeg':
case 'thm':
- header("Content-type: image/jpeg");
+ header("Content-type: image/jpg");
break;
case 'gif':
header("Content-type: image/gif");
@@ -100,6 +100,7 @@ function pass_file_and_exit($file) {
break;
}
header("Content-length: ".filesize($file));
+ header('Content-Disposition: attachment; filename="' . $i['basename'] . '"');
readfile($file);
exit;
}

0 comments on commit 43e7b3d

Please sign in to comment.