Check for write-protected file before saving; return error message to client