Added error reporting for file uploads