Added more informative error messages for attachment uploads.