From d3afef721790d8c716101db7aaab41adc6ef3f33 Mon Sep 17 00:00:00 2001 From: kapyaar Date: Fri, 11 Jul 2025 12:55:28 -0400 Subject: [PATCH] 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 --- libraries/HTTPUpdateServer/src/HTTPUpdateServer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/HTTPUpdateServer/src/HTTPUpdateServer.h b/libraries/HTTPUpdateServer/src/HTTPUpdateServer.h index 65d8cbaa783..b59a071fd9a 100644 --- a/libraries/HTTPUpdateServer/src/HTTPUpdateServer.h +++ b/libraries/HTTPUpdateServer/src/HTTPUpdateServer.h @@ -123,7 +123,7 @@ class HTTPUpdateServer { Serial.printf("Update: %s\n", upload.filename.c_str()); } if (upload.name == "filesystem") { - if (!Update.begin(SPIFFS.totalBytes(), U_SPIFFS)) { //start with max available size + if (!Update.begin(UPDATE_SIZE_UNKNOWN, U_SPIFFS)) { //Instead of SPIFFS.totalBytes(). Fix https://github.com/espressif/arduino-esp32/issues/9967 if (_serial_output) { Update.printError(Serial); }