Improved fromBase64() to parse the file extension