export table to attachment / snippet that creates an attachment

I’d like to use an export table snippet that instead of creating a download in the browser, creates an Attachment record in Salesforce. Is that possible? 

In general, is it possible to create an attachment via snippet, by specifying maybe the parent ID and the source file?