Getting Started with ApPHP AJAX File Uploader (v2.0.0 or above)

Common Notices

• Do not put ApPHP AJAX File Uploader code into another HTML Form: <form>...</form>
• Always put your code inside <html>...</html> tags

Getting Started

Step 1. Creating File Uploader object

Make sure you define a valid relative (virtual) path to the fileuploader.class.php file.
## *** include FileUploader class
define('UPLOADER_DIR', '');
ApPHP File Uploader uses several JS- and CSS-files which are included in the page body as soon as the Display function is called. If you want the inclusions to happen in the specific section of the page, you can call static IncludeJsAndCssFiles function.
## *** include CSS and JS files
Now the File Uploader object can be created.
## *** create FileUploader object
$fileUploader = new FileUploader();

Step 2. General Settings

If you want to use several independently configured FileUploader objects on a single page, you should set unique numeric (integer-valued) identifier for this FileUploader object.
## *** set id
ApPHP AJAX File Uploader supports embedded CSS styles: "dark", "light" and "simple". You can choose style using function "SetStyle". Select appropriate style to suit your needs.
## *** set CSS style
Define whether the debug mode is turned on or not.
## *** show debug info - false|true
Set folder where uploaded files are moved to
## *** set folder
$fileUploader->SetFolder("Black Hole");
Define whether progress tracking is enabled. To use this feature you must install PECL UploadProgress extension first (for instructions refer to "Installation.htm" file)
## *** show progress - false|true
## *** (PECL UploadProgress extension must be installed first)

Step 3. Filter rules

Specify whether file uploading starts immediately after it was added
## *** possible values - false|true
Specify whether the destination folder should be created automatically if it doesn't exist
## *** possible values - false|true
Allow to delete files after uploading
## *** possible values - false|true
Display file size after uploading
## *** possible values - false|true
Overwrite existing files
## *** possible values - false|true
Add a hidden field to the form being submitted
## Example: $fileUploader->AddHiddenField('key','value');

Step 4. Naming rules.

Define whether to show file icons or not.
## *** show file icons
Specifies whether to show clickable images for 'upload' and 'remove' commands
## *** show clickable images (true) or buttons (false)
Specifies whether to show 'Upload all' button
## *** show 'Upload all' button
Specifies whether to show 'Clear all' button
## *** show 'Clear all' button
Specifies number of columns displayed in file viewer
## *** number of columns displayed in file viewer - integer

Step 5. Display File Uploader

Set allowed extensions for uploaded files
## *** set allowed extensions
Set maximum allowed size for uploaded files
## *** set maximum size
Set the maximum number of files that the user is allowed to upload simultaneously:
## *** set the maximum number of files

Step 6. Naming rules.

Now you may define what names will be given to uploaded files. If you don't want their names to change, don't do anything. But you should know that ApPHP AJAX File Uploader is able to generate random names for uploaded files
## *** uploaded files are given random generated names - true|false
It can also add a prefix or a postfix to each uploaded file's name
## *** set prefix/postix which will be added to uploaded files' names
If you don't want existing files with identical names to be overwritten, turn on UseSuffixes option. Then the new files will be given names such as filename{1}.txt, filename{2}.txt etc.
## *** add suffixes like {1},{2} when file names are identical

Step 7. Display File Uploader

Now you can display FileUploader on the screen.
## *** display file uploader
You can also display file viewer in order to see what files are there in the folder specified for uploading.
## *** display file viewer
Create Your Free Account
Please remember that this information is essential to use our services correctly.
After creating the account you will be able to download all of our FREE products.
Fields marked with * are mandatory

Please send me information about updates, new products, specials and discounts from ApPHP!
We recommend that your password should be at least 6 characters long and should be different from your username/email. Please use only letters of the English alphabet to enter your name.

Your e-mail address must be valid. We use e-mail for communication purposes (order notifications, etc). Therefore, it is essential to provide a valid e-mail address to be able to use our services correctly.

All your private data is confidential. We will never sell, exchange or market it in any way. Please refer to Privacy Policy.

By clicking "Create Account", you are indicating that you have read and agree to the ApPHP Terms & Conditions.