Skip to content

Commit d3afef7

Browse files
authored
Update HTTPUpdateServer.h
if (!Update.begin(SPIFFS.totalBytes(), U_SPIFFS)) { throws an error "Update error: Bad Size Given". Changing to if (!Update.begin(UPDATE_SIZE_UNKNOWN, U_SPIFFS)) { fixes #9967
1 parent 4ee17de commit d3afef7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/HTTPUpdateServer/src/HTTPUpdateServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class HTTPUpdateServer {
123123
Serial.printf("Update: %s\n", upload.filename.c_str());
124124
}
125125
if (upload.name == "filesystem") {
126-
if (!Update.begin(SPIFFS.totalBytes(), U_SPIFFS)) { //start with max available size
126+
if (!Update.begin(UPDATE_SIZE_UNKNOWN, U_SPIFFS)) { //Instead of SPIFFS.totalBytes(). Fix https://github.com/espressif/arduino-esp32/issues/9967
127127
if (_serial_output) {
128128
Update.printError(Serial);
129129
}

0 commit comments

Comments
 (0)