Added check to see if a file upload worked, otherwise returns null. Fixes: 6672