Assuming you would like the file to be written on a PC connected to the board over USB, you should use your preferred dev platform (provided it can open a COM port on the machine, I assume all major ones do that), read the stream and write your file.