Ticket #2531876 (closed enhancement)
ReporterBrad Kusnir |
Opened: 03/9/12 Last modified: 08/1/12 Status: closed Type: enhancement Resolution: fixed |
Owner Allen Rabinovich |
Target Release: 3.6.0 Priority: P3 (normal) |
|---|---|---|---|
| Summary: | More Robust File FIlters | ||
| Description: | Only basic allowed extension file filters are supported in the Flash Uploader, this does not seem to be supported in the HTML5 uploader. Wondering if this feature is being abandoned or if it is on |
||
| Type: | enhancement | Observed in Version: | 3.5.0pr2 |
| Component: | Uploader | Severity: | S3 (normal) |
| Assigned To: | Allen Rabinovich | Target Release: | 3.6.0 |
| Location: | Priority: | P3 (normal) | |
| Tags: | uploader, file filters | Relates To: | |
| Browsers: | N/A | ||
| URL: | |||
| Test Information: | This works only for UploaderFlash (not UploaderHTML5): // allowed file filters (if setting "fileFilters" attribute below) // An array indicating what fileFilters should be applied to the file (Flash control only) |
||
Change History
|
Posted: 03/27/12
|
|
Posted: 03/30/12
|
|
Posted: 04/7/12
I think I see the problem here is with the file dialogue box. Not sure how this behaves across different operating systems as well... If you can build the functionality outside of the dialogue box (perhaps immediately after the file is selected). Right now I don't see how to intervene before the file actually gets added to the list, by which time it is too late. We need a function that runs immediately after a list updated, but then the problem is if we remove the file we are also updating the list which fires the listener. It would be nice to have the ability to not allow users to add illegal files, having some facility to profile files with regex expressions, file size, number of files in the list would be awesome. |
|
Posted: 05/2/12
I am looking forward to having working HTML5 filters as well :) |
|
Posted: 05/8/12
Custom filter function it is. Files will be run through it when the fileList is getting updated, and the "bad" ones will get rejected. |
|
Posted: 05/8/12
|
|
Posted: 05/10/12
Here is what I ended up doing would be nice to see support for whitelisting and blacklisting filenames and extensions via regex: // validation variables // illegal file extensions list // perform file validations // check for maximum file size if (test_ext) { // TO:DO do a duplicate file check // if there is error output, display it to the user Y.one("#uploadButton").on("click", function () { // remove clear links // record start time for calculating xfer rate and eta in progress bar // inititate upload |
|
Posted: 06/9/12
fileFilters are now implemented in HTML5 Uploader (for browsers in which it's supported), and there's a new attribute, filterFunction, which allows filtering files as they are added to the fileList. Furthermore, the fileList attribute is now shadowing the private _fileList property which, if very necessary, can be modified directly. |
|
Posted: 08/1/12
Shipped in 3.6.0. Marking closed/fixed. |
I haven't added the file extension filtering to HTML5 layer because it's not standard across all browsers that support HTML5 just yet. I will in 3.6 though. It works differently from Flash though; it's not by file extension, but rather by mime type.
Great idea about max/min file size control. I think I would just allow an option custom file filter function.