on 06-26-2009 1:17 PM
Dear Experts,
Can I download a file stored in KM (pdf), using Filedownload UI??
If yes then please suggest how could I do that.
Warm Regards
Upendra Agrawal
HI,
you have to add the KM service in the Sharing Reference of Web Dynpro
Portal:sap.com/com.sap.km.application
with this API you can reach the CM link.
Assign this link to you download UI.
look in this Thread.
/thread/1378577 [original link is broken]
regards
Gunter
Edited by: Gunter Werner on Jun 26, 2009 2:40 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Go throught this links
/people/bobu.georgeputheeckal/blog/2006/12/22/getting-an-image-from-km-documents-to-be-used-in-web-dynpro
If you want the code..
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
com.sapportals.portal.security.usermanagement.IUser ep5User =
com.sapportals.wcm.util.usermanagement.WPUMFactory.getUserFactory().getEP5User(sapUser);
ResourceContext context = new ResourceContext(ep5User);
/*Give the path to KM in the variable path */
RID rid = RID.getRID("/documents/DENEME");
IResourceFactory factory = ResourceFactory.getInstance();
ICollection folder = (ICollection) factory.getResource(rid,context);
String location = "E:\DynproTempFolder\";
String fileName = location+"a.pdf";
File file = new File(fileName);
// IResource res_forMap = ResourceFactory.getInstance().getResource(rid, context);
// IPropertyMap pm = res_forMap.getProperties();
String mime = new MimetypesFileTypeMap().getContentType(file);
/*Create an output stream for writing to the temperory location*/
/*From the temporary location read the file using an input stream*/
FileInputStream fin = new FileInputStream(fileName);
// fin.read();
/*Using this input stream we can write to the repository
Content content = new Content(fileelement.getFiledata(),fileelement.get) */
Content content = new Content(fin,"byte", -1L);
IResource newResource = folder.createResource("a.pdf",null,content);
fin.close();
Regards,
Saleem
Hi,
This has been discussed many times, have a look at this links
You can check this sample example from SDN
Uploading and Downloading Files In Web Dynpro Java
/people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using-webdynpro-apis
http://help.sap.com/saphelp_nw04/helpdata/en/43/85b27dc9af2679e10000000a1553f7/content.htm
Uploading and Downloading Files In Web Dynpro Tables
Some more links regarding Uploading and DownLoading Files
Hope this helps you...
Regards,
Saleem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.