DialogFilter Property

php Uploader

PHP File Uploader Class Reference

Uploader.DialogFilter Property

Gets or sets the current file name filter string, which determines the choices that appear in the file browser dialog box. Please note that only ValidateOption.AllowedFileExtensions property determine the allowed file extensions for uploading.

Remarks

For each filtering option, the filter string contains a description of the filter, followed by the vertical bar (|) and the filter pattern. The strings for different filtering options are separated by the vertical bar.

The following is an example of a filter string:

Text files (*.txt)|*.txt|All files (*.*)|*.*

You can add several filter patterns to a filter by separating the file types with semicolons, for example:

Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*


Example Code

  1. <?php require_once "phpuploader/include_phpuploader.php" ?>   
  2. <html>   
  3. <body>   
  4.         <form id="form1" method="POST">   
  5.             <?php   
  6.                 $uploader=new PhpUploader();   
  7.                 $uploader->Name="myuploader";   
  8.                 $uploader->DialogFilter="Images (jpg/gif/png)|*.jpg;*.gif;*.png|All files (*.*)|*.*";   
  9.                 $uploader->Render();   
  10.             ?>   
  11.         </form>   
  12. </body>   
  13. </html>