<<< Back to the TFU FAQ
8. How to use the flash if not all files are in one directory?
The default installation is having all files (including the calling page - by default: tfu.htm) in one directory. In a little bigger system you many want to have e.g. all tfu files in one sub directory and include the flash in your own application. I make a small example how the configuration should look like. You have to use at least TFU 2.8 that the example below works! If you plan to use the flash behind a security software you should read this too and 8. is very important for you.
- Lets assume you have all your tfu files in the folder /plugins/tfu, your page that includes the flash is in / and the folder you want to upload is /upload.
- The tfu_login.php has always to be in the directory where the calling page is - in this example this would be /.
You can only change this if you change this in the source code. I have hard coded this because of security reasons (Not good if a caller can maybe use his own config file!)
- Adapt the path to the swfobject.js in the page you include tfu - in our example: plugins/tfu/swfobject.js.
- To find the xml language files you have to set the 'base' parameter at the flash. This is needed here because language files are loaded before the config is even loaded. - in this example you would have to add ?base=plugins/tfu/.
- Set the $install_path in tfu_login.php to the path where the tfu files are located - in this example: $install_path="plugin/tfu/"; This is important that the helper, users, license file, and the other tfu_*.php are found.
- Finally you have to set the path of the upload dir relative to the tfu folder! In this example you have to set $folder = "../../upload"; in tfu_config.php.
- If you you registered tfu copy the license file to the directory where the flash is - in this example: plugin/tfu/
It's possible to have a different setup: You have the flash + the tfu_login.php in one folder and the other files in a different folder. This is needed if you want to use TFU in a protected folder. tfu_upload.php cannot be inside this folder because Firefox is not passing the cookies properly and most likely your login software will restrict the access to tfu_upload.php. Therefore you have to place the flash and tfu_login.php into the protected folder and the other tfu files in a unprotected folder. Do the setup like described above plus you have to set $upload_file relative to the flash.
Test:
Put an image in your upload dir. Then you see if the flash can read your remote directory properly. If not please check the paths. Then select an image - a preview has to be shown. Then upload a file. If this three steps work the flash is working. If no directories can be created check the permissions. TFU writes errors to a file called tfu.log in the directory where the tfu_helper.php is located.
|