Access documents using just the Browser or Mobile Device

December 27, 2013

Access documents using just the browser or mobile device in FileCloud Did you ever wonder that you needed to preview a file before downloading it to your local system and cluttering it with a huge number of files? With so many operating systems, it is possible that every computer that wants to access your files […]

Access documents using just the browser or mobile device in FileCloud

Did you ever wonder that you needed to preview a file before downloading it to your local system and cluttering it with a huge number of files? With so many operating systems, it is possible that every computer that wants to access your files has Microsoft Office installed. Sometimes, you might also need to just view the contents of a large file without downloading it to your local machine. It might also happen that you might be travelling with just your smartphone or tablet and you want to have a look at certain documents!

Search no more- FileCloud provides the feature of document preview and on setting it up successfully, you would be able to view the contents of documents like Word Files, Spreadsheets, Presentations within your browser.

FileCloud uses OpenOffice to get the contents of the file on the server and the PDF.js to render the contents on your browser. By default, OpenOffice is not installed on your system and hence, document review is turned off. You need to install this remotely. The instructions are also available in the documentation.

Install OpenOffice

To get the tar file of OpenOffice, you need to run the following command. In this case, I take the OpenOffice 4.0.1 debian version for Ubuntu.

    wget http://sourceforge.net/projects/openofficeorg.mirror/files/4.0.1/binaries/en-US/Apache_OpenOffice_4.0.1_Linux_x86-64_install-deb_en-US.tar.gz/download -O Apache_OpenOffice_4.0.1_Linux_x86-64_install-deb_en-US.tar.gz

The next step is installing some dependencies

    sudo apt-get install libxt6
    sudo apt-get install libxrender1
    sudo apt-get install openjdk-6-jre-headless

Then, you need to extract the contents of your OpenOffice package and install the debian packages there.

    sudo tar zxvf path_to_your_OpenOffice_file
    cd en-US/DEBS
    sudo dpkg -i *.deb

Running OpenOffice Server

In the following step, we set up permissions for running the OpenOffice server.

    sudo chown www-data:www-data /var/www
    sudo su - www-data -c 'mkdir .openoffice'

The next step is to start the OpenOffice server. Make sure that you start the OpenOffice server from the same user which you were logged in as while installing FileCloud.

    sudo cd /var/www
    sudo su - www-data -c '/opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard'&

Setting Permissions on FileCloud

Login to your Admin account on FileCloud and click on Settings. In the Settings page, click on the Misc tab, and set the “Open Office Location” under the heading Document Preview Support.

If you followed the instructions in this tutorial, this path should be /opt/openoffice4/program/. Only read permissions are required to use document preview.

Next, on the left panel, select “Customization” and go to the “General Tab”. Check the “Show Document Preview” checkbox. Save the settings and you should be good to go with Document Preview.

When you click on any file in the end user portal, you get an option to preview the document. The preview of a doc file rendered using PDF.js looks like that shown below.

A presentation looks like the one shown below.

We hope that this post helped you set up a document preview in FileCloud. You can always refer to the documentation or leave a comment below if you have any issues with the process.

By Team FileCloud