on 04-06-2009 12:53 PM
Hi all,
I need to upload a file via webdynpro java to send to an e-mail.
I'm using Netweaver 04 web dynpro Java. In 04s we have a type IWDResource, but in this version, we
don't have this type
I'd defined a resource file (type binary), a file name (type string) in content.
my problem is how can I get the URL of the file that I'm uploading, to send via e-mail?
thank you
Hi
try this
wdContext.currentContextElement().getResourceURL();
thanks
AB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need a type com.sap.ide.webdynpro.uielementdefinitions.Resource attribute for propertie Resource and then:
InputStream input = wdContext.currentXXXelement().getResource().read(false);
and you can send it like an attachment using java mail or EJB Mail:
props = new Properties();
initialContext = new InitialContext(props);
session = (Session) initialContext.lookup("java:comp/env/mail/MailSession");
mailSession = Session.getInstance(session.getProperties(), null);
transport = mailSession.getTransport("smtp");
transport.connect();
/* build the email */
transport.sendMessage(msg, to);
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.