Requirement: I have a page wherein tabular data is displayed. On click of a button, this data should be exported to an excel, attached to a mail and sent.
What I have done till now: I have achieved export to excel functionality in Grails using the export plugin.
And Mail Functionality using outlook Object in javascript as in below post. Outlook message to pop up before ma开发者_StackOverflowil is sent in grails
However when I use OutlookObject I mention the attachment as below.
var attach1 = "c:\\temps\\test.txt"
In this case the attachment is taken from the local drive.
Question: While I export my tabular data to an excel, Is there a way to save the file to the local drive so that the attachment can be read from the same location and sent in the mail as an attachment.
Thanks in advance!
Unfortunately you can't tell a browser where to save something or ask it for the location of a recently saved file so not really. What you could do is have the file exported and saved both to the users hard drive and somewhere online and use the online version when sending the email.
Not sure if it helps here but generally there is no way to access the local file system in JavaScript.
精彩评论