Improved mandatory element test in upload controller