I`m trying to send a binary file (png image) in http response.
FILE *file; char *buffer; int fileLen; //Open file file = fopen(\"1.png\", \"rb\"); if (!file
I tried to follow what you did but could not get it to work. Instead, I found it easier to just send header and file separately.
e.g.
send(client, header, strlen(header), 0); send(client, buffer, fileLen + 1, 0);