Merge "Use file extension based on MIME type" am: 5c8f5fdeb1 am: 5002cebb6e

Change-Id: I43642aabb5e52426e07d3081eda78b17894bbc58