Last active
March 8, 2019 10:08
-
-
Save musebe/1a3843362be20f59beb91068a4f1d5e9 to your computer and use it in GitHub Desktop.
cloudinary upload script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
document.getElementById("upload_widget_opener").addEventListener("click", function () { | |
cloudinary.openUploadWidget({ | |
cloud_name: 'your_cloud_name', | |
upload_preset: 'your_upload_preset', | |
max_image_width: 300, | |
max_image_height: 300, | |
crop: 'limit' | |
}, | |
function (error, result) { | |
console.log(error, result) | |
// Push URL into text input | |
document.getElementById('url_text').value = result[0].url; | |
res.redirect("/files"); | |
}); | |
}, false); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment