0

I'm running an automated script off of the server, and for security reasons the automation program does not have permissions to write to a specific server.

Right now I pull a bunch of data from a database and then save it into a CSV on the host machine, and then the program emails that file and deletes it.

Well this won't work on the server since it does not and will not have permissions. Is there a straightforward way to have all this data saved to a string for example, and email it as a csv attachment so that it never has to write to the server?

klashar
  • 2,519
  • 2
  • 28
  • 38
rohanharrison
  • 233
  • 4
  • 10
  • 2
    You can store it as its bytes in memory, then funnel that to your e-mail as the attachment. It's done here as a PDF: http://stackoverflow.com/questions/23962634/using-sendmessage-to-email-a-file-attachment-without-saving-the-file – CDove Feb 24 '17 at 14:23
  • Creating and sending an email does always happend in memory. Writing a file is an extra step to persist data (temporaly). In your case write code as usal and leave this step out. – Reporter Feb 24 '17 at 14:24
  • @user1895086 That works, thank you! – rohanharrison Feb 24 '17 at 14:54

0 Answers0