0
This post helped me to resolve my issue . Basically what was wrong is that my file input was the first child of the form instead of at the end. Please see the below stackoverflow link for full answer .
https://stackoverflow.com/a/17524079/274715 .
I am still not sure why moving the file to the end helped me .
Source:stackexchange.com