Meteor 来自cfsFileUrl处理程序的CollectionFS图像url不工作
我遵循了collectionFS指南和其他几个stackoverflow问题[here][1],但在显示图像时仍然会遇到错误。此时将显示断开的图像图标,控制台将打印“资源解释为图像,但使用MIME类型text/html传输:”。你知道我能做些什么来解决这个问题吗 我的代码如下: HTML 服务器JSMeteor 来自cfsFileUrl处理程序的CollectionFS图像url不工作,meteor,Meteor,我遵循了collectionFS指南和其他几个stackoverflow问题[here][1],但在显示图像时仍然会遇到错误。此时将显示断开的图像图标,控制台将打印“资源解释为图像,但使用MIME类型text/html传输:”。你知道我能做些什么来解决这个问题吗 我的代码如下: HTML 服务器JS if(Meteor.isServer){ ImagesFS.fileHandlers({ default1: function(options) { // Options co
if(Meteor.isServer){
ImagesFS.fileHandlers({
default1: function(options) { // Options contains blob and fileRecord — same is expected in return if should be saved on filesytem, can be modified
console.log('I am handling default1: ' + options.fileRecord.filename);
console.log(options.destination());
return { blob: options.blob, fileRecord: options.fileRecord }; // if no blob then save result in fileHandle (added createdAt)
}
});
}
我通过以下方式手动添加cfs公用文件夹包实现了这一点:
meteor add cfs-public-folder
现在,文件显示在浏览器中,并且URL指向
http://localhost:3000/cfs/<collectionFS name>/<imageId_fileHandler.ext>
http://localhost:3000/cfs//
工作
cfs-public-folder
不再在0.9.x上工作
请使用:
.url()
像
对贫穷的开发人员没有帮助???:
cfs-public-folder
.url()
MyColletionCFS.findOne().url()