2 Replies Latest reply on Jan 12, 2014 11:03 AM by jpatro

    How to get the Src of uploaded image in jive 6.0.3?

    manish12nov

      As a part of a plugin, On a custom page, I am uploading an image and i need to store the uploaded image src as an URL  in my custom DB for retrieving the image back on some other page.

      How can i achieve it?

        • Re: How to get the Src of uploaded image in jive 6.0.3?
          jpatro

          Easy Way

          Go for struts file upload action :

          String filePath = "Provide JiveHome and a custom";

          l

          File fileToCreate = new File(filePath, this.userImageFileName);

          FileUtils.copyFile(this.userImage, fileToCreate);

           

          Ftl:

          <form action="userImage" method="post" enctype="multipart/form-data">

              <input type="file" name="userImage" label="User Image" />

              <input type="submit" name="submit" value="submit" />

          </form>

          End user side retreive the same using :

          http://localhost:8080/resources/statics/ ...... (file name and path combination).

           

          best way:


          to override the v3 apis, you can refer the html widget for file uload

          Look for the Web service : api/core/v3/places/1000/statics

          {

            "type" : "static",

            "filename" : "your filename",

            "author" : {

              "name" : {

                "givenName" : " ",

                "familyName" : " ",

                "formatted" : " "

              },

              "type" : "person",

              "displayName" : "admin admin",

              "jive" : {

                "level" : {

                  "name" : " ",

                  "points" : 

                },

                "username" : "admin"

              },

             

            },

           

          hope it helps!!

          1 person found this helpful