Skip to content

Commit bc09207

Browse files
committed
Return error 500 when upload fails immediately (e.g. filesystem full)
1 parent cb98a52 commit bc09207

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino

+3
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,9 @@ void handleFileUpload() {
513513
}
514514
DBG_OUTPUT_PORT.println(String("handleFileUpload Name: ") + filename);
515515
uploadFile = fileSystem->open(filename, "w");
516+
if (!uploadFile) {
517+
return returnFail("CREATE FAILED");
518+
}
516519
DBG_OUTPUT_PORT.println(String("Upload: START, filename: ") + filename);
517520
} else if (upload.status == UPLOAD_FILE_WRITE) {
518521
if (uploadFile) {

0 commit comments

Comments
 (0)