0
我正在試圖遵循Meteor CollectionFS指令來獲得一個簡單的文件上傳工作。我已經添加了以下內容:客戶端文件上傳使用cfs文件系統
在model.js
Images = new FS.Collection("images", {
stores: [new FS.Store.FileSystem("images", {path: "~/uploads"})]
});
在Server.js我發佈此收集和client.js我訂閱了它。
在模板時,我得到的文件,並在集合中插入如下:
Images.insert(files[0], function (err, fileObj) {
//Inserted new doc with ID fileObj._id, and kicked off the data upload using HTTP
if(err) console.log(err);
});
但是,這將引發一個錯誤 - 500 Meteor.error,內部服務器錯誤。 有人知道爲什麼會發生這種情況嗎?