2016-02-23 44 views
0

我改变了问题,因为我已决定使用yogiben包..我想包括多个附件在我的web应用程序中。以下是我的附件架构... attachments:{ type: [Object], optional: true, autoform:{ afFieldInput: { type: 'fileUpload', collection: 'Images', label: 'Choose file', } } }, "attachments.$.id":{ type:String, autoform:{ afFieldInput: { type: 'fileUpload', collection: 'Images', label: 'Choose file', } } }, 和this是我使用的FScollection使用yogiben添加多个附件

var imageStore = new FS.Store.GridFS("images",{}); Images = new FS.Collection("images", { stores: [imageStore], filter: { maxSize: 10000000, // in bytes allow: { contentTypes:`````````text/plain','application/vnd.openxmlformats- officedocument.presentationml.presentation' , '应用/ PDF', '应用程序/ msword', '应用程序/ vnd.openxmlformats-officedocument.wordprocessingml.document', '应用程序/ vnd.openxmlformats-officedocument.spreadsheetml.sheet','应用程序/ vnd.ms-Excel的, '应用/ XLS', '应用程序/ x-XLS', '应用程序/压缩', '应用程序/八位字节流', '应用程序/ x压缩','APPLI应用/ x-zip-compressed'], 扩展:['png','tif','pptx','jpeg','jpg','doc','docx', 'PDF', 'XLSX', 'XLS', 'TXT', 'GIF', '拉链'] }, onInvalid:功能(消息){

Materialize.toast(message,4000,'alert-failure');; 
} 

}
});

回答

0

您也可以使用集合FS。
他们还提供了一个很好的文档。
这里是Link