- Upload Suite Overview
- What's New?
- Choosing Upload Technology
- Evaluating Upload Suite
- Upload Suite Editions
- System Requirements
- Installation and Deployment Notes
- ActiveX/Java Uploader
- HTML5/Flash Uploader
- Before You Started with HTML5/Flash Uploader
- HTML5/Flash Uploader Architecture
- HTML5/Flash Uploader User Interface
- Getting Started
- Using HTML5/Flash Uploader
- Troubleshooting
- Reference
- HTML5/Flash Uploader ASP.NET Reference
- HTML5/Flash Uploader PHP Reference
- AddFilesProgressDialog Class HTML5/Flash Uploader PHP
- BaseClientControl Class HTML5/Flash Uploader PHP
- BaseControl Class HTML5/Flash Uploader PHP
- ClientEvents Class HTML5/Flash Uploader PHP
- CommonDialog Class HTML5/Flash Uploader PHP
- ConvertedFile Class HTML5/Flash Uploader PHP
- Converter Class HTML5/Flash Uploader PHP
- DescriptionEditor Class HTML5/Flash Uploader PHP
- DrawTool Class HTML5/Flash Uploader PHP
- FlashControl Class HTML5/Flash Uploader PHP
- ImageEditor Class HTML5/Flash Uploader PHP
- ImagePreviewWindow Class HTML5/Flash Uploader PHP
- ImageUploaderFlash Class HTML5/Flash Uploader PHP
- Messages Class HTML5/Flash Uploader PHP
- Metadata Class HTML5/Flash Uploader PHP
- Package Class HTML5/Flash Uploader PHP
- PaneItem Class HTML5/Flash Uploader PHP
- PostFields Class HTML5/Flash Uploader PHP
- Restrictions Class HTML5/Flash Uploader PHP
- Restrictions Members HTML5/Flash Uploader PHP
- Restrictions Properties HTML5/Flash Uploader PHP
- DeniedFileMask Property HTML5/Flash Uploader PHP
- EnableCmyk Property HTML5/Flash Uploader PHP
- FileMask Property HTML5/Flash Uploader PHP
- MaxFileCount Property HTML5/Flash Uploader PHP
- MaxFileSize Property HTML5/Flash Uploader PHP
- MaxImageHeight Property HTML5/Flash Uploader PHP
- MaxImageWidth Property HTML5/Flash Uploader PHP
- MaxTotalFileSize Property HTML5/Flash Uploader PHP
- MinFileCount Property HTML5/Flash Uploader PHP
- MinFileSize Property HTML5/Flash Uploader PHP
- MinImageHeight Property HTML5/Flash Uploader PHP
- MinImageWidth Property HTML5/Flash Uploader PHP
- StatusPane Class HTML5/Flash Uploader PHP
- TopPane Class HTML5/Flash Uploader PHP
- UploadErrorDialog Class HTML5/Flash Uploader PHP
- UploadHandler Class HTML5/Flash Uploader PHP
- UploadPane Class HTML5/Flash Uploader PHP
- UploadSettings Class HTML5/Flash Uploader PHP
- UploadedFile Class HTML5/Flash Uploader PHP
- AmazonS3Extender Class HTML5/Flash Uploader PHP
- FileSettings Class HTML5/Flash Uploader PHP
- HTML5/Flash Uploader JavaScript Reference
- HTML5/Flash Uploader Client-Side Events Reference
- POST Field Reference
- Licensing Information
- Legal Notices
Restrictions.FileMask Property HTML5/Flash Uploader PHP
Gets or sets a file mask for files allowed for upload.
Syntax
public function getFileMask() {
}
public function setFileMask($value) {
}
Property Value
Type: string
A file mask for files allowed for upload. The property value is a JSON string that contains array of filters. Each item consists of two elements:
- Description string displayed in the drop-down filter list in the open file dialog.
-
List of file masks separated by semicolons. A file mask has the
*.<extension name>format, where asterisk*is an arbitrary file name.
For instance, a filter can be set as follows: [["Images", "*.jpg;*.png"], [...]], where "Images" is a description,
and "*.jpg;*.png" is a file mask.
Even if a user chooses files that do not meet FIleMask's requirements, Uploader sorts out the chosen files before adding them to the Upload Pane.
In Flash Uploader a file mask with a long description can work incorrectly due to Firefox limitations. Thus, we recommend setting description as short as possible.
For example, ["Documents", "*.txt;*.rtf;*.pdf;*.doc;*.docx;*.xls;*.xlsx"] works correctly
but ["Documents (*.txt;*.rtf;*.pdf;*.doc;*.docx;*.xls;*.xlsx)", "*.txt;*.rtf;*.pdf;*.doc;*.docx;*.xls;*.xlsx"] does not.
Due to browsers limitations, HTML5 Uploader ignores filter descriptions specified in settings and displays text strings predefined in a web browser. Even though descriptions are ignored, they are still required in parameters since Flash Uploader, which can be launched as a fallback option, supports them.
Due to Firefox security features, HTML5 Uploader always adds *.* mask to the file filter in this browser and makes it selected by default.
Instead of specifying a double array, you can just set a string with the single mask. However it will be incompatible with Flash uploader.
Default value is "[]".
Remarks
When opening a File Open Dialog in HTML5, it is necessary to specify a filter as a set of MIME types rather than file masks. HTML5 Uploader converts most popular file masks to appropriate file types automatically, but some exotic file extensions are not supported. In this case, you can configure a mapping between a file mask and MIME type manually, using Aurigma.MimeMapping collection, as follows:
Aurigma.MimeMapping["*.smth"] = "application/vnd.aurigma-stuff";
Note, you should call this code before the uploader is initialized, for example, in the InitComplete event.
See Also
Reference
- DeniedFileMask Property
- Aurigma.ImageUploaderFlash.Restrictions.FileMask ASP.NET Property HTML5/Flash Uploader
- $au.restrictions.fileMask JavaScript Property HTML5/Flash Uploader