Arduino Ethernet: Website off of SD-Card

Hi guys,

I got some questions where I cannot help myself:

I want to host my website from a sd card. I went to GitHub - adafruit/SDWebBrowse: File browsing using the Arduino Ethernet shield and used that code and it worked, so that I am now able to view the content of my sd-card over the network.

But: When I click on the .html-file the browser opens it as an pure text-document. I see the whole html-syntax but it is not translated so that I see the resulting webpage.

UPDATE: It DOES work with the internet explorer. Why not in Firefox??

Example: That’s what I see, when I click on the html-file:

<!DOCTYPE html> 
	<meta name="viewport" content="width=device-width, initial-scale=1"> 
 $(document).bind("mobileinit", function() {
 $ = true;
	<link rel="stylesheet" href="" />
	<script src=""></script>
	<script src=""></script>

<div id="home" data-role="page" data-add-back-btn="true">

	<div data-role="header" >
	</div><!-- /header -->

and so on…what do I have to do, so that my browser translates it to a finaly webpag?


You asked for plain text. If that is not what you want, then remove it.

 client.println("HTTP/1.1 200 OK");
 // remove the next line
 client.println("Content-Type: text/plain");

Oh my....that's it! Thank you SO much! :)