Skip to content

Instantly share code, notes, and snippets.

View jamielob's full-sized avatar

Jamie Loberman jamielob

View GitHub Profile
@jamielob
jamielob / upload.js
Created October 18, 2016 23:07 — forked from cmcewen/upload.js
Upload image from React Native to Cloudinary
var CryptoJS = require('crypto-js');
function uploadImage(uri) {
let timestamp = (Date.now() / 1000 | 0).toString();
let api_key = 'your api key'
let api_secret = 'your api secret'
let cloud = 'your cloud name'
let hash_string = 'timestamp=' + timestamp + api_secret
let signature = CryptoJS.SHA1(hash_string).toString();
let upload_url = 'https://api.cloudinary.com/v1_1/' + cloud + '/image/upload'