【问题标题】:Meteor access file that stored at /.meteor/local/cfs存储在 /.meteor/local/cfs 的 Meteor 访问文件
【发布时间】:2014-04-12 12:01:05
【问题描述】:

大家好,我在我的陨石应用程序中使用 CollectionFS GridFS 和 cvs-filesystem。这是我的初始化代码:

Images = new FS.Collection("images", {
    stores: [new FS.Store.FileSystem("images", FS.Store.rootPath)]
});

我将上传的图片存储到 root 或 /.meteor/local/cfs/files/images/uploadedfile

请帮助我,如何访问存储在 /.meteor/local/cfs 的文件? 所以我可以获取网址并显示上传的图片。

【问题讨论】:

    标签: javascript meteor meteorite


    【解决方案1】:

    万岁终于找到了。

    在这种情况下,我有:

    Images = new FS.Collection("images", {
        stores: [new FS.Store.FileSystem("images", FS.Store.rootPath)]
    });
    

    这意味着将存在带有名称图像的文件夹,并将其存储到带有名称图像的集合中。 所以它会产生一个这样的网址:

    var img = Images.files.findOne({_id : 'fileid'});
    => /cfs/files/images/' + img._id + '/' + img.name + '?store=images
    

    但现在我不知道如何跟踪上传过程,希望这对大家有帮助:)

    如果我知道该怎么做,会更新这个答案。

    CMIIW

    【讨论】:

      猜你喜欢
      • 2016-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-28
      • 2014-10-28
      • 1970-01-01
      • 2012-05-13
      • 1970-01-01
      相关资源
      最近更新 更多