I am building a small http server. I am able to send html,css,xml files to the client over HTTP. But I am not able to send image files-.jpg,.png.gif. How do I send it so the browser is able to display the image.
Thanks.
Send it just like any other (binary-data) file, with the correct Content-Type and Content-Length headers.
Content-Type for:
您可能应该正确设置图像的MIME类型。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.