vfportero / autoform-cloudinary

Easily upload images to Meteor using Cloudinary and Simple Schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

This package lets you use Cloudinary with autoform/simpleschema to easily upload an image to your Cloudinary account, and it automatically saves the url for the image using autoform.

Usage

  1. meteor add cosio55:autoform-cloudinary

  2. Set up settings.json file

{
  "public": {
    "CLOUDINARY_API_KEY": "[YOUR API KEY]",
    "CLOUDINARY_CLOUD_NAME": "[YOUR CLOUD NAME]"
  },

  "CLOUDINARY_API_SECRET": "[YOUR API SECRET]"
}
  1. Create collection and attach simple schema
Images = new Mongo.Collection('images');

Images.attachSchema(new SimpleSchema({
  image: {
    type: String,
    autoform: {
      afFieldInput: {
        type: 'cloudinary'
      }
    }
  }
}));
  1. Create quick form
<template name="imageForm">
  {{> quickForm collection="Images" type="insert" id="add-image"}}
</template>
  1. Run meteor

meteor --settings settings.json

About

Easily upload images to Meteor using Cloudinary and Simple Schema


Languages

Language:JavaScript 74.6%Language:HTML 24.5%Language:CSS 0.9%