Fix fatal error when downloading files

Issue with bytes being cast incorrect resolved by decoding first