The 315 PLC itself could send TCP messages (if it has an Ethernet port), but it doesn't have any native concept of files. If you had an external PC program, it could take those messages and turn them into a file. Something like an external data logger could potentially grab and store the data for you as well.
I think the most straightforward way is to use a CP343-1, which then supports protocols like FTP. If you have a secure Ethernet connection between . It might support email as well, but unfortunately this is typically hard to use because modern email systems expect all kinds of security, and PLC's rarely support any.
It might be possible to do it as you said in an HMI. I assume you're using a Siemens panel. There are two potential ways to do this. One would be a standard data log, although I don't know if those support strings. The other would be to write a script that creates a file on the USB stick. One thing to watch out for, however, is that I think the panels only check for the presence of a USB stick when they boot up. Once the stick is not present, it won't be able to use it until you restart the HMI. The error messages it gives you in this case are often unclear or nonexistant.
Are you trying to get the data sent to you from someone offsite, or are you trying to stay within the same network?