这也许是一个菜鸟的问题,但是上传成功后如何显示上传的图像呢?
就像<img src='theuploadedimage' />
发布于 2013-12-31 10:25:40
请查找文档这里。
cfsFileUrl:返回给定文件的文件URL,由给定的文件处理程序分配。
{{#each images}}<!-- images come from Images.find() -->
<li><p>{{_id}}</p>
<img src="{{cfsFileUrl fileHandler}}" alt="{{_id}}">
</li>
{{/each}}文件处理程序需要定义服务器端,例如:
if (Meteor.isServer) {
var handler = {
"fileHandler": function (options) {
return {
blob: options.blob,
fileRecord: options.fileRecord
};
}
}
Images.fileHandlers(handler);
}Images是你的CollectionFS。
https://stackoverflow.com/questions/20855259
复制相似问题