I am using React as framework to create input for a project. Input is a name, photo and an optional comment. The name and comment I got working, but the photo (being a file) gives me some trouble.
I am using this as a method for uploading. (I know that the quality of the photo must be very low to use base64 for it, but that is not a problem for this project.)
However, when I used this code, my browser threw an Unexpected token error in the console, at a location where there was just a tab. I have located the error to this piece of code (by commenting out different pieces).
reader.onload = function(output){
fileUpload.set({
file: output.target.result
});
$.when(fileUpload.save())
.done(function(){
this.setState({
uploaded: true
});
}.bind(this));
}.bind(this));
I just can't see what is wrong with it and why it is throwing that error.