如何将 Cloudinary 与 Meteor 集成 [英] How to integrate Cloudinary with Meteor

查看:56
本文介绍了如何将 Cloudinary 与 Meteor 集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用户为他们的个人资料上传照片,并且我希望在他们登录时在导航栏上显示他们的照片.

这些是 lepozepo:cloudinary 包的说明(我对其他替代品持开放态度):

第一步

服务器

Cloudinary.config云名:'云名'api_key: '1237419'api_secret: 'asdf24adsfjk'

客户

$.cloudinary.config云名:云名"

步骤 2

连接你的输入[type="file"].客户端.

Template.yourtemplate.events更改输入[type='file']":(e) ->文件 = e.currentTarget.filesCloudinary.upload 文件,folder:"secret" # http://cloudinary.com/documentation/upload_images#remote_upload 中描述的可选参数(错误,res)->#optional 回调,您也可以使用 Cloudinary 集合console.log "上传错误:#{err}"console.log "上传结果:#{res}"

对于每个步骤,我不确定将代码放在哪里.例如,我不知道应该把 Cloudinary.config 放在哪里.在服务器上的什么位置?

标题客户-帮手配置文件-样式表-模板轮廓个人资料.html配置文件.js-main.html-main.js库-集合服务器-配置*cloudinary.js-fixtures.js-publications.js

cloudinary.js

Cloudinary.config({cloud_name: '***',api_key: '***',api_secret: '***'});

profile.html