リンクをクリックすると、/downloads/download/randomhash が開きます。
randomhash がデータベースにある場合、ダウンロード カウンターをインクリメントしてから、実際のファイル (/uploads/2012/file.png など) にリダイレクトします。
私がやりたいことを行うリダイレクトを除いて、すべてが機能します。なぜ機能しないのかわかりません...
header("Location: " . $row->uri);
header("Content-Disposition: attachment; filename=$row->name");
ファイルの最初のロードでは、適切な content-disposition ヘッダー (firebug 内) がありますが、ファイルをダウンロードするように求められません (そうすべきですよね??)。何か案は?
応答ヘッダー:
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, public
Connection: Keep-Alive
Content-Disposition: attachment; filename=promotion_photo_2.jpg
Content-Encoding: gzip
Content-Length: 20
Content-Type: text/html; charset=utf-8
Date: Mon, 27 Feb 2012 01:01:22 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive: timeout=5, max=100
Location: /uploads/2012/mediakitD3CF.jpg
Pragma: no-cache
Server: *
Vary: Accept-Encoding
X-Powered-By: *
X-UA-Compatible: IE=Edge,chrome=1