Loading images of different media such as css beside just him from sd card

I am reading this code , but i get lost when I reach the point

         if (strstr(filename, ".htm") != 0)
            client.println("Content-Type: text/html");
        else if (strstr(filename, ".css") != 0)
            client.println("Content-Type: text/css");
        else if (strstr(filename, ".png") != 0)
            client.println("Content-Type: image/png");
         else if (strstr(filename, ".jpg") != 0)
            client.println("Content-Type: image/jpeg");

my question is what is filename variable storing in each if condition ? usually when we read it any programming language we open file and read line by line , or different strategy,. but here I don't :slightly_frowning_face: :sleeping:

strstr checks a string to see if another string is present inside of it. SO the first if checks to see if the filename contains .htm, so it is an html file. The second one checks to see if it contains .css so it is a css file. It then appears to be sending to the client to let him know what type of file is coming.

filename has probably been setup somewhere else but you didn't show me that part of the code so I don't know.