Skip to Content

Upload Image to KM Repository

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Feb 02, 2005 at 11:33 PM

    Hi Sid,

    for the case you want to develop such a thing, see Uploading Document from client browser and/or File Upload Problem using JSPDynPage in EP5 (PDK 5.0.6)

    If any questions should stay open, just ask.

    Hope it helps

    Detlev

    Add a comment
    10|10000 characters needed characters exceeded

    • Detlev Beutner Siddhartha Bhattacharya

      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

  • author's profile photo Former Member
    Former Member
    Posted on Feb 02, 2005 at 10:12 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.