ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By Ovaltineo
#14461 I tried using updateweb.cgi to update webpages.espfs OTA. The upload finishes successfully, but the filesystem doesn't work -- I get a not found 404 error for any page I want to load. Here's my upload page - am I doing something wrong?


<html>
<body>

<form action="updateweb.cgi"
enctype="multipart/form-data" method="post">
<p>
Please specify a file\:<br>
<input type="file" name="datafile" size="40">
</p>
<div>
<input type="submit" value="Send">
</div>
</form>
</body>
<html
User avatar
By prozac
#14534 Not sure which version of the code you are using (assuming mine with the OTA support), but at this time, that function hasn't been fully implemented. While there is a function (cgiUpdateWeb) in cgiflash.c to handle a form based upload (thanks for the work bjpirt), it hasn't been tested so I left out a mapping. If you would like to work on finish it, by all means jump in! In the end, I found that the curl based flash was what I needed to spee dup my dev work and the forms based upload wasn't as helpful.

h the binary upload using CURL, the binary is the post data. Nothing more, mothing less. That makes it easy to buffer and flash. With the form based upload, we still have to buffer the post data (can't load the whole image into RAM), but then we have to parse the post data looking for the begining of the binary data. Once we find that, we can send the data to a second buffer and do the flashing. Much more work and testing to make sure we don't do something stupid ;)

Maybe sometime next week I can take a look at it if you don't get a chance to before me.
User avatar
By lightfever
#17889 Hi, any progress on that topic maybe?

I also try to find out how to upload .espfs.

dont we need to pass the address too (address=0x12000) ?
in the Makefile there is "Makefile:ESPFS_POS = 0x12000" but not sure if it's really passed to the cgiflash.c file.

also, there is a note in the source:
// The source should be 4byte aligned, so go ahead and flash whatever we have

would be nice if anyone get this working
cheers
lightfever