我的文件上传过滤器无法与Alfresco YUI(或flash?)上传一起使用。 我有以下代码:
if (null == this.fileUpload) {
this.fileUpload = Alfresco.getFileUploadInstance();
}
var filter = new Array({description:"Images", extensions:"*.jpg;*.png;*.gif"});
var uploadConfig = {
mode: this.fileUpload.MODE_SINGLE_UPLOAD
, username: Alfresco.constants.USERNAME
, siteId: Alfresco.constants.SITE
, uploadDirectory: '/'
, containerId: 'Logo'
, filter: filter
, onFileUploadComplete: {
fn: this.onFileUploadComplete
, scope: this
}
};
this.fileUpload.show(uploadConfig);
这很酷,文件上传也可以。我可以上传文件,没有问题。但问题是过滤器没有。我在这个配置中缺少什么?
我正在使用Alfresco Share Community版本4.2c。
答案 0 :(得分:2)
zladuric,
我认为过滤器必须单独定义。以下对我有用:
this.fileUpload = Alfresco.getFileUploadInstance();
var description = "Images";
var extensions = ["*.jpeg", "*.jpg", "*.png", "*.gif"];
var filter = new Array(
{description: description, extensions: extensions[0]},
{description: description, extensions: extensions[1]},
{description: description, extensions: extensions[2]},
{description: description, extensions: extensions[3]}
);
var uploadConfig = {...};
this.fileUpload.show(uploadConfig);
我希望这会有所帮助。