Updated bytestream handler to go through file type checks