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

Change-Id: I251a15bdfcb3bf3316ab640cee3f31dc4be4cfc5