将 Filepicker.IO 与 Meteor 集成
问题描述:
我一直在检查 Meteor 作为 Web 应用程序的潜在框架,我需要做的一件事是允许我的客户通过该应用程序上传文件.我开始检查 Filepicker.io 作为合并此功能的途径,但我无法让拖放字段呈现.它在测试 Rails 应用程序上运行良好,但在我的演示 Meteor 应用程序上,它看起来就像一个空白的输入框.
I've been checking out Meteor as a potential framework for a web application and one thing I need to be able to do is allow my clients to upload files through the app. I started checking out Filepicker.io as an avenue to incorporate this functionality but I'm having trouble getting the drag/drop field to render. It works fine on a test Rails app but on my demo Meteor app, it just looks like a blank input box.
答
我通过 wget http://api.filepicker.io/v1/filepicker.js
那我就可以了
meteor.startup ->
filepicker.setKey 'lalala'
然后通过
Template.fileUpload.rendered = ->
filepicker.constructWidget document.getElementById('uploadWidget')