2016-02-23 60 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