I've gotten all functions of server.c to work, including displaying hello.html successfully. However, when I attempt to access cat.html, program is not displaying the image. The chrome developer screen shows no errors and appears below. enter image description here

I don't see any errors on developer console.

Also, not sure why content type message is appearing in browser on cat.html. It doesn't on hello.html.

Perhaps related, if I attempt to access cat.jpg through server, the downloaded file errors when I attempt to open as below:

cat.jpg opening error

My implementation of "respond to client" mirrors the php version except no piping and no headers removed. I've checked permissions on cat.jpg file and they seem fine as -rw-r--r--. Do I need to have a different write function if the file requested is a .jpg instead of an html? Please just point me in the right direction. It's been tons of hours, so far.

1 Answer 1


Solved! cat.jpg displaying without extraneous text. Problem had to do with placement of "write" statement. Also, apparently had to add another "\r\n" line.

  • I have the same problem but i don't understand what you did to solve it . can you explain more ?
    – kawegan
    Oct 19, 2015 at 21:59
  • Same happens to me, and i didn't understood what you've done. However, if i GET /cat.jpg HTTP/1.1 from telnet, a lot of bytes is passed.
    – user10187
    Nov 30, 2015 at 15:29
  • Well, now it works. I've implemented lookout passing the extension + \r\n, by doing this, i should have not added additional \r\n in respond to client. Now its showing correctly in chrome
    – user10187
    Nov 30, 2015 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .