我需要一些关于meteor-files包的帮助我正在关注最简单的下载DEMO https://github.com/VeliovGroup/Meteor-Files/tree/master/demo-simplest-download-button并获得一些保险杠 . 首先是代码:
this.Books = new Meteor.Files({
debug: true,
collectionName: 'Books'
});
// To have sample file in DB we will upload it on server startup:
if (Meteor.isServer) {
Books.denyClient();
Books.collection.attachSchema(Books.schema);
Meteor.startup(function () {
if (true) {
Books.load('http://localhost:3000/file.pdf', {
fileName: 'file.pdf',
meta: {}
});
}
});
Meteor.publish('Books', function () {
return Books.find().cursor;
});
} else {
Meteor.subscribe('Books');
}
- 问题 - 当我从git中获取代码时会出现这种情况
(!Images.find() . count())
流星只是不承认它是一个功能并在那里打破 . 我修复了它,只需将其替换为TRUE,就像你在代码中看到的那样
- 问题是现在一切都运行了,我的文件被成功导入但我可以在服务器日志中看到他无法找到导致的文件:
[FilesCollection] [load]收到:http://localhost:3000/file.pdf I20160806-14:00:27.190(2)? [FilesCollection] [load] [insert] file.pdf - > Books I20160806-14:00:29.360(2)? [FilesCollection] [find(undefined)] I20160806-14:00:33.045(2)? [FilesCollection] [find(undefined)]
1 回答
这个软件包已经过时了,需要我这边的流星更新 . 如果有人需要