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

Change-Id: I3fd4dbdc8732cb063035b2c6796f3c94acfd79ce