on 2005 Feb 02 9:50 PM
Is it possible to upload an image from a user's machine, store it in a KM folder/rep and get the complete URL for that?
I have an iview which displays a form with the file upload option. Is there a way (perhaps using KM APIs) to add this image to a KM repository and display the URL of the stored image to the user?
Thanks
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sid,
yes, but KM API is very intuitive. Read the API, just look around, you'll get very fast an overview.
ResourceContext context = new ResourceContext(iUser);
RID rid = RID.getRID(pathToRepAndFolder);
IResourceFactory factory = ResourceFactory.getInstance();
ICollection folder = (ICollection) factory.getResource(rid, context);
Content content = new Content(new FileInputStream(fuFile.getFile()), fuFile.getContentType(), -1);
IResource newResource = folder.createResource(nameOfFile, null, content);
should give you a good starting point.
Hope it helps
Detlev
Hi Siddhartha,
If you have content Admin Privileges>Under KM content, select the folder where you want to upload the image, int the menu select folder> New-->Upload. You can Upload many images, and select the properties of the image by clicking on the context menu and selecting the details > Settings->properties--->AccessLinks (WebDEv URL).
If you are interested in looking at creating iview, Try looking at com.sap.portal.pdk.srv.urlgenerator under PDK and try URLGeneratorComponent.
Hope this helps,
Thanks,
Praveen
PS. Dont foget to award points if useful/solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
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.