-->
Page 1 of 3

FSBrowser

PostPosted: Wed Jul 01, 2020 4:42 pm
by Hairyloon
https://github.com/esp8266/Arduino/tree ... /FSBrowser

What an excellent bit of example code. Truly outstanding: it does very much what I need it to do, with the things that I want to do looking like they are within reasonably easy grasp.
Upload the code to the chip, and straight away there is a file browser, with the facility to upload files and a text editor: an easily set up website on a chip.
What more could we reasonably expect?

I can think of almost nothing: it would be handy to have the facility to easily download everything all in one, and perhaps that feature is there, but I just have not found it yet.

It is probably desirable to have a password to protect the file manager, but that is perhaps not ideal in example code, and should be easy enough to add.

What I want to do next is to set it up as an access point, and put it down the allotment, to serve as an information exchange point. Possibly I will need to set up a few, on a mesh, in order to cover the whole site, but we can cross that bridge when we come to it.

Re: FSBrowser

PostPosted: Mon Apr 11, 2022 8:08 am
by CouchPotato
I am new at this, so please pardon if this is a basic question. I have looked through the fsbrowser code several times and can not understand exactly what makes the program serve index.htm from the littlefs file system. Can anyone help me with this?

I understand making an html page in program memory and sending it to a browser but again what in the fsbrowser code gets the program to send index.htm from the littlefs file system.

Re: FSBrowser

PostPosted: Wed Apr 13, 2022 7:52 pm
by Hairyloon
CouchPotato wrote:I am new at this, so please pardon if this is a basic question. I have looked through the fsbrowser code several times and can not understand exactly what makes the program serve index.htm from the littlefs file system. Can anyone help me with this?


At risk of being the blind leading the blind, I think that's handled by the Webserver library. Serving index.htm is the default thing that they do.

Re: FSBrowser

PostPosted: Thu Apr 14, 2022 5:28 am
by btidey
In the function handleFileRead(String path)

there is the line

if(path.endsWith("/")) path += "index.htm";

So if you call with url with no file specified then it defaults to index.htm