Съдържание

Progress Bar (Plugin)

What this plugin does

This plugin displays a progress bar when you are uploading a file through Feng Office. It requires Perl to be installed on the server. Uploads are performed through a Perl script that saves the uploaded file to the tmp folder in Feng Office, along with info about the total size of the file. The GUI periodically calls a PHP script that calculates the progress based on the size of the temporary file and the total size of the file. The progress bar is updated with this info, showing how much of the file has been uploaded.

How to install this plugin

1- Make sure you have installed Perl with CGI, FILE::COPY, FILE::PATH, and IO::File
2- Unzip the plugin into your Feng Office installation
3- Edit file 'cgi-bin/upload.pl' (included with the plugin) and set the correct values for variables:
	- OG_ROOT:  Path on the server to the Feng Office installation.
	            e.g.: /var/www/fengoffice
	- OG_URL:   URL to your Feng Office installation (must match ROOT_URL defined in config/config.php)
	            e.g.: http://www.mydomain.com/fengoffice/
	- MAX_SIZE: Maximum allowed upload size in bytes.
	            e.g.: 10000000  # for 10 MB
4- Copy file 'cgi-bin/upload.pl' to your server's cgi-bin directory. Make it executable.
	- e.g., on Linux:
		cp cgi-bin/upload.pl /var/www/cgi-bin/upload.pl
		chmod +x /var/www/cgi-bin/upload.pl
5- Define a constant PROGRESS_UPLOAD_SCRIPT on 'config/config.php' with the URL to the upload script you copied in step 3.
    - e.g.: define('PROGRESS_UPLOAD_SCRIPT', 'http://www.mydomain.com/cgi-bin/upload.pl');
6- Define a constant UPLOAD_HOOK on 'config/config.php' with the value 'progress'.
	- i.e.: define('UPLOAD_HOOK', 'progress');
7- Check the installation:
	a- Browse to <URL to your upload.pl>?check
		You should get "Script configured correctly!"
	b- Browse to <URL to your Feng Office>/index.php?c=progress&a=test
		You should get a file upload form where you can test your script.
	c- Try uploading a file on your Feng Office ;) 

How to use this plugin

While uploading a file, you will notice a progress bar showing what percentage of the file has been uploaded.