on 08-01-2008 7:17 AM
Hi All,
I want to upload a file from webdynpro to KM repository.
The file is to be pick from the end user place.
and then it is to be uploaded in KM.
So pls send me some links of Documents for achieving this.
Thanks & Regards,
Dhruv Shah
Hi see this links i hope it will help in some extent
/thread/29720 [original link is broken]
Thanks,
Tulasi Palnati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check the links inside this thread
https://www.sdn.sap.com/irj/sdn/thread?threadID=564552
Here is the code by ERAY for the same.... in the thread https://www.sdn.sap.com/irj/sdn/thread?threadID=564552
try{
com.sap.security.api.IUser sapUser = com.sap.security.api.UMFactory.getAuthenticator().forceLoggedInUser(request,response);
sapUser.getAccessibilityLevel();
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();
//file.delete();
PradeeP
Edited by: pradeep bondla on Aug 1, 2008 8:52 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.