Author: pyaschenko
Date: 2008-09-26 09:18:57 -0400 (Fri, 26 Sep 2008)
New Revision: 10572
Modified:
trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/swf/fileUploadComponent.swf
Log:
https://jira.jboss.org/jira/browse/RF-4533
Modified: trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as
===================================================================
--- trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as 2008-09-26 12:08:32 UTC (rev
10571)
+++ trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as 2008-09-26 13:18:57 UTC (rev
10572)
@@ -87,10 +87,10 @@
for (var i:Number = 0; i < list.length; i++) {
if (this.fileRefList.length==this.maxFiles) break;
item = list[i];
- /*if (!this.checkFileType(item.type) || !this.checkDuplicated(item.name)) {
+ if (!this.checkFileType(item.name) || !this.checkDuplicated(item.name)) {
ExternalInterface.call(this.getComponentString()+"._flashFireEvent('ontyperejected',
{})");
continue;
- }*/
+ }
item.addListener(this);
this.fileRefList.push(item);
this.fileDataList.push("{creationDate:
"+this.getJSDateString(item.creationDate)+", creator:
'"+item.creator+"', modificationDate:
"+this.getJSDateString(item.modificationDate)+", name:
'"+item.name+"', size: "+item.size+", type:
'"+item.type+"'}");
@@ -132,10 +132,10 @@
}
private function checkFileType (fileType) {
- if (fileType.charAt(0)=='.') fileType = fileType.substr(1);
if (!this.acceptedTypes || this.acceptedTypes['*']) { return true; }
- var type = fileType.toLowerCase();
- if (this.acceptedTypes[type]) {
+ var p:Number = fileType.lastIndexOf('.');
+ if (p!=-1) fileType = fileType.substr(p+1); else fileType="";
+ if (this.acceptedTypes[fileType.toLowerCase()]) {
return true;
}
return false;
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/swf/fileUploadComponent.swf
===================================================================
(Binary files differ)