Examples

Keeping state after submitting

A sample demonstrating how to keep the uploaded file state across page posts. Upload a few files, submit the form, and the list survives the round trip.

Now: 09:34:05

Demo code

<?php
    $uploader = new PhpUploader();
    $uploader->MultipleFilesUpload = true;
    $uploader->MaxSizeKB = 10240;
    $uploader->Name = "myuploader";
    $uploader->InsertText = "Select multiple files (Max 10M)";
    $uploader->AllowedFileExtensions = "*.jpg,*.png,*.gif,*.bmp,*.txt,*.zip,*.rar";
    $uploader->Render();

    // after the post, look each guid up again
    $mvcfile = $uploader->GetUploadedFile($fileguid);
?>
Testing the demo: upload a file, press Submit Form, and note that the file list and the clock both update while the state is kept.