logo elektroda
logo elektroda
X
logo elektroda

[Solved] ESP8266 Web Server: Incomplete File Downloads for HTML, CSS, JS Files

dasej 522 2
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18536357
    dasej
    Level 32  
    Hello

    This is how I retrieve data from the ESP8266 memory (esp-12) and send to the browser.
    Code: Lua
    Log in, to see the code
    .

    As I had the page in one file everything was OK.
    But I decided to split it into 3 files, index.html , file.css , file.js

    And this is where the problems started. The browser downloads all three files
    but not the whole thing, only the first ~1000 bytes of each file goes to the browser.
  • ADVERTISEMENT
  • #2 18536688
    TvWidget
    Level 38  
    Once you have sent a portion of data, you must wait for the event that it has been sent. Then send another portion and so on. Once the whole thing has been sent, you need to close the connection.
    Of course, it's a good idea to do this in parallel for each file being downloaded. The browser will probably request all of them at once.
  • #3 18726141
    dasej
    Level 32  
    The position of the download must be counted.
ADVERTISEMENT