It tells you upfront exactly what the error is. You did not define the handleFileSelect
callback function.
Define the function for God's sake.
That's how you define a function:
function handleFileSelect()
{
//code
}
Just put this snippet before you add the listener and it'll throw no error.