Examples

File Upload with Custom handler

A sample demonstrating how to implement a custom upload handler that accepts the incoming files. In the handler page (UploadUrl) you can rename the uploaded files and run any other logic programmatically.

Allowed file types: jpg, gif, png, bmp. Maximum file size: 10 MB.

Demo code

<?php
    $uploader = new PhpUploader();
    $uploader->MultipleFilesUpload = true;
    $uploader->InsertText = "Select multiple files (Max 10M)";
    $uploader->MaxSizeKB = 10240;
    $uploader->AllowedFileExtensions = "*.jpg,*.png,*.gif,*.bmp";
    $uploader->UploadUrl = "demo2_upload.php";
    $uploader->Render();
?>
Testing the demo: each file is handed to demo2_upload.php, which renames it with a myprefix_ prefix before saving.