e600e8e6b4
Also correctly extract the original file extension. Co-authored-by: Andrew Nicols <andrew@nicols.co.uk> Co-authored-by: Mazitov Artem <maz@2i.tusur.ru>