on 06-16-2011 3:43 PM
Hi
We have a requirement to send the contract document(Microsoft word document) as an attachment in a custom email. We have to do this through scripting. I am able to send a mail with attachement. However I am unable to send the word document successfully. This is because I am unable to fetch a file stream of the word document. The Approach I am using is as follows.
1) Retrieve the contract document as an object of AttachmentIfc
2) Use the attachementIfc object to get the servlet download link(relative URL)
3) Build the complete URL, from the base servlet URL
4) Create an object of URL class by supplying the URL created above
5) Use this URL object to create a connection and retrieve the resource at the end of the URL as a filestream.
I am able to receive the word document through the mail. However the document contains an error page with the message u201CYour session is no longer valid Please log into the applicationu201D
My understanding is a new session was created and hence the error page was retrieved instead of the document. How do I avoid creating a new session or how do I retrieve the parameters of the existing session in order to open the URL in the same session. Is there a way I can use the session id to maintain the current session?
Please let me know if this can be done or if there is an alternative method to retrieve the document?
Your inputs are highly appreciated.
Thanks and Regards,
Immanuel
Solved.
I used an alternative approach to fetch it from the DB directly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.