only attempt to delete file if it exists
stop using strings and encoding and pass everything as Uint8Array (fixes downloading corruption)