I am trying to upload a photo using Lepozepo / cloudature
This is the configuration of my server and client
server:
Cloudinary.config({ cloud_name: '*****', api_key: '******', api_secret: '********' });
customer:
$.cloudinary.config({ cloud_name: "*******" });
I tried to upload an image using the form
html form code:
<form> <input type="file" id="userimage" name="userimage"/> <button type="submit">Upload</button> </form>
And this is mine, this is an event for the template
Template.signup.events({ // Submit signup form event 'submit form': function(e, t){ // Prevent default actions e.preventDefault(); var file = $('#userimage')[0].files[0]; console.log(file) Cloudinary.upload(file, function(err, res) { console.log("Upload Error: " + err); console.log("Upload Result: " + res); }); } });
When I click the download button, nothing happens, I just got an error message
error: uncaught TypeError: Failed to execute 'readAsDataURL' on `'FileReader': parameter 1 is not of type 'Blob'.`
What can I do to make this work?
source share