2

我的文件上传过滤器不适用于 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。

4

1 回答 1

2

兹拉杜里克,

我相信过滤器必须单独定义。以下对我有用:

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);    

我希望这有帮助。

于 2013-09-23T15:02:26.367 回答