Improved file upload error handling.