Skip to content

Commit 54154c7

Browse files
authored
Merge pull request #11586 from kapyaar/master
Update HTTPUpdateServer.h to Fix SPIFFS Update error: Bad Size Given
2 parents da73b4e + b977457 commit 54154c7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libraries/HTTPUpdateServer/src/HTTPUpdateServer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef __HTTP_UPDATE_SERVER_H
22
#define __HTTP_UPDATE_SERVER_H
33

4-
#include <SPIFFS.h>
54
#include <StreamString.h>
65
#include <Update.h>
76
#include <WebServer.h>
@@ -123,7 +122,7 @@ class HTTPUpdateServer {
123122
Serial.printf("Update: %s\n", upload.filename.c_str());
124123
}
125124
if (upload.name == "filesystem") {
126-
if (!Update.begin(SPIFFS.totalBytes(), U_SPIFFS)) { //start with max available size
125+
if (!Update.begin(UPDATE_SIZE_UNKNOWN, U_SPIFFS)) { //Instead of SPIFFS.totalBytes(). Fix https://github.com/espressif/arduino-esp32/issues/9967
127126
if (_serial_output) {
128127
Update.printError(Serial);
129128
}

0 commit comments

Comments
 (0)