I am writing a C based server supporting HTTP. &buffer[5] has the file name. I set the header in next step and then send the file in block of 8Kb. It is working fine whe
If your code is working for txt files, give fread/fwrite a try instead of read/write . There might be a problem with NULL characters in jpg image which are not present in txt files. And do include a content length in header otherwise in some cases your browser will keep on requesting even if your download has finished. In simple words browser don't know when to stop.