Firefox Redirect Filename Bug
Bug #657621 is open since 2011 and not even confirmed!
Affects: Firefox for Windows, Firefox for Android. Latest stable versions (as of December 2015)
Reproduction
- An URL "redirect.php" redirects to an image "dolphin.jpg" using a 30x status code and a "Location" HTTP header
- When the user wants to save the image, the recommended file name is "redirect.php" instead of "dolphin.jpg", although "dolphin.jpg" is in the title/URL bar.
Test it yourself
Click here for a simple HTTP redirect to a picture.
After it is loaded, try to save it using Rightclick -> "Save Image as". The filename will be wrong. If you save the image as file with PHP extension, people cannot view the image using their image viewer.
Expected Result
Filename: dolphin.jpg
Actual result
- Using right-click and then "Image Save as": redirect.php
- Using File->Save page as menu: dolphin.jpg
- Using Ctrl+S: dolphin.jpg
- In Firefox for Android: redirect.php.jpg


Source code of redirect.php:
header('Location: dolphin.jpg');