The TWG Flash Uploader is a very comfortable way for your users to upload file to a remote server. Because it's based on flash it can be used by almost everyone. You can simply upload files by selecting files on your hard drive andsimply press the upload button.
For more details please go to the web page.
Please check the source code of this page how to integrate TFU properly.
You will find 2 swf's in the download: tfu_<version>.swf and tfu_preloader.swf. The tfu_preloader.swf does only load the main flash and shows a small percentage counter. The flash is only ~130k - therefore it's up to you if you want to provide the loading status.
By default the preloader is not enabled because if you are registered and download is enabled you get an error from the flash plugin if you download a file. If you don't enable downloads you can use the preloader without restrictions.
Requirements
Client: Flash >= 8, Java >= 1.4.x if you want to use the file split applet
Server: php >= 4.3.5 + gdlib installed + if you use apache: mod_secuity has to be disabled or can be disabled by the provided .htaccess file (See FAQ 1 of the TFU Howto/FAQ).
URL parameters
lang is the switch for the language - valid entries are de, en, fr, es, bg, br, it, cn, cz, nl, ct, da, no, pl, pt, se, sk, tw and jp e.g. Add this to the flash e.g. tfu_213.swf?lang=de
session_id - you can specify a session id by passing the current session id if you want to share your current session with the tfu_* files - it will be added to every call to the server. Please note: If you want to pass variables over the session this parameter is mandatory because Firefox does not handle this properly otherwise! Since TFU 2.12 this value is read by Javascript internally from the Flash. If you are sure that Javascript is always available you don't need to specify this parameter anymore.
session_name - The default of this value is TFUSESSID. I do not use the default PHPSESSID because it you set session. use_trans_sid=off then this would be filtered and upload would fail! I recommend NOT to change this. You have to change php code as well if you do!
base - This is only needed if you use the flash if not all files are in one directory. Needed to load the language files properly - Read howto 8 of the TFU FAQ.
tfu_description_mode=true - Only use this if you want to enable the description mode. The flash is then loaded already with the grid layout needed for the description mode. If you don't set this then you see the Size/Date colums for a very short moment. Only use this if you have a professional license or above because otherwise it simply does not work because the functionality is NOT attached to this parameter.
hide_remote_view=true - Use this if you want to hide the remote view. The flash is then loaded already with the layout without the remote view. If you don't set this then you see the remote view for a very short moment. Don't forget to set this in the config too because the functionality is NOT attached to this parameter.
big_server_view=true - Use this if you want the server side the same size as the upload. The flash is then loaded already with the right layout. If you don't set this and only in the config then you see the default view for a very short moment. Don't forget to set this in the config too because the internal functionality is NOT attached to this parameter.
c_* - color settings of the flash - available if you have a professional license or above. See howto 9.
All other settings are done in the tfu_config.php - The parameters are explained there. Please read the faq on the web pagefor more info's.
Available languages:
The flash does now show language flags too - check the tfu_config.php : $language_dropdown and read the documentation there to configure it properly!
Here a status is displayed if you have Javascript events defined and a license file exists.
Please note: TFU has to be installed on a web server because it reads all it's setting from the server! If you only open the tfu.htm file from you local hard drive the flash displays an error.
Have fun using TFU.
How to setup TFU secure!
Please go to the website and read TFU how-to 13. It's important to make a secure setup on your system!
Server settings
By calling the tfu_config.php directly you get some server settings displayed. This are the limitations of your server - not of TFU. Please read the TFU how-to 4 on the website if you want to increase the upload limit. You can open this page by clicking here.
Latest version
Currently the latest version of TFU is:
Using the external interface of TFU
You can refresh the file list by Javascript by clicking here.
This is e.g. used in WFU where the thumbnails are generated in an extra step and to keep the listing of the flash and the file in synch.
The following function can be used:
function refreshFileList() {
var obj = document.getElementById("flash_tfu");
if (obj && typeof obj.refreshFileList != "undefined") {
obj.refreshFileList();
}
}
Upload post-processing plugins
Since version 2.9 TFU does support that you can include and execute your own code after the upload. In TinyWebGallery e.g. the cache images are automatically created. You can e.g. write a log file or enter the upload data to your database.
On the TWG Website you find e.g. a log and a database plugin which you can use or adapt to your own needs. You will find there how to install the plugins and how to create your own.
On the website you get more help if you have a problem using/installing TFU. Check the TFU how-to 1 first if you have any problems. If this does not solve your problem please use the forum.
Password encryption
I have added a small password generator in the file tfu_password_generator.php. I have included this generator below in a small iframe ;).
TFU file split applet
Many servers have a very small upload limit and this does not allow
to upload images or movies in the original size.
The TFU file split applet is a small Java applet where you can split your files into smaller pieces and store it back on your hard disk.
You can then upload these pieces with TFU and they are merged in the backend.
If you want your user to get around this limit you can offer them this applet. Not all server do support files that are bigger than the upload size (e.g. files can't be opened after upload although they are merged ok- see the File Split Applet page how you can test this).
You need JDK >= 1.4 installed to use this applet.
The applet needs access to your hard disk to read/write the files.
This is only possible with a signed applet. If you open the applet you get a warning:
"The application's digital signature is invalid. Do you want to run the application"
This is because this is a selfsigned applet. If you want to verify that this is the original applet that
comes from the TinyWebGallery web site click here for instructions how to verify the signature manually.