Version 4

    Summary

    Jive can be configured so that any uploaded attachments, images, documents, or avatars will be stored on the web app file system instead of the database. In this scenario, Jive's storage system is configured to use the File Storage System, which is also known as the bin store. This is the default configuration for Hosted and Cloud instances, and is the recommended configuration for On-Premise instances. Storing files in the file system, instead of in the database, will result in faster performance and a smaller application database.

     

    If your Jive instance is configured to use the file storage system, and you have access to your Jive instance's database and file storage, then there may be times when you need to locate specific documents or attachments that are in the file system. You will need to follow the steps outlined in the example below to determine how to locate a specific file in the file storage system.  Please note, the naming scheme and location of the files are optimized for high performance, which can make locating files by hand difficult.

     

     

    Example of finding a specific file in the file system

    In this example we will upload an attachment in Jive and then use the database records to locate the actual file on the file system on the web app node.

     

    Step 1 - Upload a file in Jive

    In this example we will create a new document and add an attachment to the document called image.png

     

    Screen Shot 2015-08-13 at 2.45.42 PM.png

     

    Step 2 - Find the Object ID in the application database

    Here we will query the database to file the attachment id for the uploaded attachment for the specific piece of content. Here the ObjectType is 102 (Document) and the Object ID is 1031. The Object ID can be gathered from the URL.

     

    The object type is unique for each type of content in Jive.  A list of common object type values can be found at the bottom of the document.

    The specific table you will need to query is unique to the type of uploaded file. You can find a reference guide at the bottom of this document in the Common File Storage Binkey Formats section

     

    SELECT attachmentid, filename, contenttype FROM jiveattachment WHERE objecttype = 102 AND objectid = 1031;

    attachmentid | filename  | contenttype

    --------------+-----------+-------------

            1005 | image.png | image/png

    (1 row)

               

     

    Here we can see that the attachment ID for this particular file is 1005.

     

    Alternatively, you can view the attachment in Jive and look at the URL to find the attachment ID:

     

    /servlet/JiveServlet/download/1031-2-1005/image.png

               

     

    Step 3 - Generate the name of the file in the file storage system based on the attachment ID

    There are 4 steps to taking the attachment ID and determining the actual name of the file that lives in the file system:

    1. Prepend the file type, plus a hyphen, to the beginning of attachment ID
      1. Note, you can find a complete list of file types used in the bin store at the bottom of this document in the Common File Storage Binkey Formats section
    2. The hyphen character must be encoded to the characters '45'
    3. The resulting string must be reversed
    4. Add .bin to the end of the string

     

    Example:

    1. Prepend the file type, plus a hyphen, to the beginning of attachment ID
      1. Step 1 Result: attachment-1005
    2. The hyphen character must be encoded to the characters '45'
      1. Step 2 Result: attachment451005
    3. The resulting string must be reversed
      1. Step 3 Result: 500154tnemhcatta
    4. Add .bin to the end of the string
      1. Step 4 Result: 500154tnemhcatta.bin

     

    In this example the file for the attachment will have the name of '500154tnemhcatta.bin' in the file system.

     

    Step 4 - Locate the Jive File Storage System directory

     

    You can go to Admin Console: System > Settings > Storage Provider to find the location of where Jive's file storage provider will save files.

     

    In this example it will be /mnt/jive_binstore/jiveSBS

    Screen Shot 2015-08-13 at 3.09.06 PM.png

     

    Step 5 - Find directory that the file is in

    Now that we know the name of the file, and the root directory that the file storage provider, we can now find the specific directory that the attachment is in.

     

    File name: 500154tnemhcatta.bin

    File storage root directory: /mnt/jive_binstore/jiveSBS

     

    To find the specific directory of the file, we will need to take the first 3 characters of the file and turn those into 3 levels of directories.

     

    Example: For file 500154tnemhcatta.bin we know that the file will be located in 5/0/0 in the file storage root directory.

     

    The complete directory of the file is /mnt/jive_binstore/jiveSBS/5/0/0

     

    Step 6 - Locate the file and rename it

    At this point we have the following information:

    File name: 500154tnemhcatta.bin

    File storage root directory: /mnt/jive_binstore/jiveSBS

    File location: /mnt/jive_binstore/jiveSBS/5/0/0

     

    We can now find the file at /mnt/jive_binstore/jiveSBS/5/0/0/500154tnemhcatta.bin

     

    You can download a copy of this file and rename it to the original file name stored in in the database. In this example, we can rename the file to image.png and open it in an image viewer.

     

    Related Materials

     

    Common File Storage Binkey Formats

     

    ContentBinkey Format
    Binary documentsbinaryBody-<ID doc body version (jiveDocBodyVersion table)>
    Attachmentsattachment-<ID of attachment (jiveAttachment table)>
    Profile Images

    attachment-<ID of attachment>

    (Note: that when uploading a profile image we save the same image in five different sizes, so there will be five attachment rows and five entries in the binstore)

    AvatarsSame as profile image, but only creates one attachment
    Image embedded in content via RTEimage-<ID of image (jiveImage table)>

     

     

    Common Object Types

     

    -2 - systemcontainer

    1 - thread

    2 - message

    3 - user

    4 - group

    13 - attachment

    14 - community

    18 - poll

    20 - Private Message

    22 - announcement

    25 - Status Level jiveID counter

    26 - avatar

    37 - blog

    38 - blogpost

    40 - trackback

    41 - Tag

    48 - userstatus

    49 - user relationship

    73 - formattedtext

    102 - document

    105 - comment

    107 - Rating

    110 - binaryBody

    111 - image

    120 - documentversion

    129 - documentbackchannel

    370 - permissionlevel

    501 - profileimage

    600 - project

    602 - task

    604 - projectstatus

    700 - socialgroup

    701 - jiveSGroupMember MembershipID counter

    702 - privatesocialgroup

    800 - bookmark

    801 - external-site

    1200 - mobile

    2020 - usercontainer

    1100 - Video

    96891546 - Event

    535535779 - Photo Album

    1464927464 - Wall entry

    3227383 - Idea (ideation plugin)

    109400031 - Share

    1527402675 - CarouselContainerType

    106642994 - Photo

    jive-ask-a-question.png?a=145945776139