服务端发送图片 1.打开图片文件 // 1. 打开图片文件 ifstream is(filepath, ifstream::in | ios::binary); if(!is.is_open()) { cout<<"open failed"<<endl; exit(0); } 2.获取图片文件长度 // 2. 计算图片长度 is.seekg(0, is.end); int length = is.tellg(); is.seekg(0