Custom file preview in Bitrix24.Drive

24 June 2022

next article
Vyacheslav Nahnybida

PR manager

Vyacheslav Nahnybida
Custom file preview in Bitrix24.Drive

Previewing has become an integral part of many services that store a variety of files. Seeing the contents of a file without opening it is not only convenient, but also necessary, especially when there are many such files. This feature first appeared in computer operating systems. After that, it became clear that in the future this is not just a convenient option, but an urgent need for the interface of any file storage location. However, in the standard version of Bitrix24, the preview is not available everywhere and only for certain file types. Avivi's system upgrade eliminates these inconveniences and makes Bitrix24 even better and more user-friendly.

Standard Bitrix24 preview

The  virtual storage Bitrix24.Drive can store completely different files, depending on your needs. The system is able to work with many of their types, but with each in its own way. For example, from 2021, text documents, presentations and spreadsheets are edited directly in Bitrix24 without the help of third-party services. Virtually all types of images are displayed not only when opening files, but also in preview mode. To do this, the user must select the view types "small tile" or "large icons" — in the type "list" there is no such possibility. Files that the system does not interact with are indicated by a common white icon. Therefore, you can have an idea of ​​the contents of such a file only by name or extension.

1 (1).png

World practice proves that preview plays an important role for users. This allows you to spend many times less time identifying the contents of the file when viewing the general array of information, faster to find the right files and in general it is logical and modern. Unfortunately, documents, videos and even distributed PDFs in Bitrix24 remained unrecognized. The system simply substitutes icons corresponding to file types, which significantly worsens the level of user perception. Therefore, it is quite justified that Avivi received an order to customize the Bitrix24 box, where the customer wanted to see previews of most of the saved files.

Custom preview

It is quite possible to accomplish this task, because the creators of Bitrix24 have already done something themselves. However, it is almost impossible to predict all possible cases at once, because not all file formats require a preview, and in some it is not required in principle. For example, the fairly popular * .csv file, which can store any tabular information, usually looks like a single long strip of code. Therefore, previewing such a file will not give anything useful.

The customer himself has outlined a list of desired formats, the files of which should be displayed on Bitrix24.Drive with a preview. This includes all office formats (especially presentations that clients work with most often), PDFs, video files, and several image formats that are not processed by Bitrix24.


To perform the task, our specialists customized the disk.folder.list component, which is responsible for displaying files, in particular on Bitrix24.Drive. To do this, special parameters were added and special libraries were connected — separately for each of the required formats. In general, you can repeat this in any on-premise eddition of Bitrix24 and for any file format you need. The main thing is that it already has the necessary library, because it greatly simplifies the process.

Avivi developers have also provided the ability to update previews. To do this, changes were made to the onAfterAddFille and onAfterDeleteFile system events. Therefore, the preview image is generated immediately after uploading it to the virtual disk. It`s clear with single images, for multi-page documents it will be a picture of the first page, and for video — a screenshot of the first frame. However, if changes are made to the file, Bitrix24 will capture and "redraw" the preview. The developers wanted to keep all the tricks of the image creation process a secret.

So another customization from Avivi has made Bitrix24 even better and more convenient for its customers. If you are also interested in seeing a preview of the files in your own Bitrix24.Disk — contact the Avivi team and we will be sure to customize your server version. In addition, we still have many options for custom functionality that complete and improve the system.

Similar articles
Apply for a consultation

We will reach out to within 10 minutes