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


i reading this code , lost when reach  point


code: [select]
         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 filename variable storing in each if condition ?
usually when read programming language open file , read line line , or  different strategy,.
but here don't  :smiley-sad: :smiley-sleep:

strstr checks string see if string present inside of it.  first if checks see if filename contains .htm, html file.  second 1 checks see if contains .css css file.  appears sending client let him know type of file coming. 

filename has been setup somewhere else didn't show me part of code don't know. 


Arduino Forum > Using Arduino > Programming Questions > Loading images of different media such as css beside just him from sd card


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor