Fixed bug with file upload: bad logic in code threw an uncaught exception.
Fixed bug with file upload: bad logic in code threw an uncaught exception.