Overview
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.
NOTE: The naming scheme and location of the files are optimized for high performance, which can make locating files by hand difficult.
Process
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. NOTE: All the URLs and images mentioned are for example only.
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
Step 2 - Find the Object ID in the Application Database
- Let's query the database to file the attachment ID for the uploaded attachment for the specific piece of content. Here, the
objecttype
is102 (Document)
and theobjectid
is1031
. - The Object ID can be gathered from the URL.
- The Object Type is unique for each type of content in Jive.
- The specific table you need to query is unique to the type of uploaded file. Refer to the Recognizing the Common File Binkey Format and Common Object Types article for more information.
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:
- Prepend the file type, plus a hyphen, to the beginning of attachment ID. NOTE: You can find a complete list of file types used in the bin store in the Common File Storage Binkey Formats article.
- The hyphen character must be encoded to the characters '45'.
- The resulting string must be reversed.
- Add .bin to the end of the string.
Example:
- Prepend the file type, plus a hyphen, to the beginning of attachment ID.
Result: attachment-1005 - The hyphen character must be encoded to the characters '45'.
Result: attachment451005 - The resulting string must be reversed.
Result: 500154tnemhcatta - Add .bin to the end of the string.
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
Step 5 - Find the 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.
- Filename: 500154tnemhcatta.bin
- File storage root directory:
/mnt/jive_binstore/jiveSBS<
- To find the specific directory of the file, take the first three characters of the file and turn those into three 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
- Example: For file 500154tnemhcatta.bin we know that the file will be located in
Step 6 - Locate the file and rename it
- At this point we have the following information:
- Filename: 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 filename stored in the database. In this example, we can rename the file to image.png and open it in an image viewer.
Comments
0 comments
Article is closed for comments.