Skip to content

[ESP8266HTTPUpdateServer library] [WebUpdate example] false "Update Success" response if no file selected #7721

Closed
@rejnok93

Description

@rejnok93

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP-01
  • Core Version: 2 Aug 2020 (2.7.4)
  • Development Env: Platformio
  • Operating System: MacOS

Settings in IDE

  • Module: Generic ESP8266 Module
  • Flash Mode: qio
  • Flash Size: 1MB
  • lwip Variant: ?
  • Reset Method: ?
  • Flash Frequency: 40Mhz
  • CPU Frequency: ?
  • Upload Using: OTA
  • Upload Speed: -

Problem Description

Steps to reproduce + Actual behaviour:
When user not select any file for FileSystem, and click update filesystem, server respond message that update is succesfull - not true.
Expected behaviour:
Server respond that update fails, because no file is sent!

MCVE Sketch

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>

#ifndef STASSID
#define STASSID "test"
#define STAPSK  "test"
#endif

const char* host = "test";
const char* ssid = STASSID;
const char* password = STAPSK;

ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;

void setup(void) {
  WiFi.mode(WIFI_AP_STA);
  WiFi.begin(ssid, password);
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    WiFi.begin(ssid, password);
  }
  MDNS.begin(host);
  httpUpdater.setup(&httpServer);
  httpServer.begin();
  MDNS.addService("http", "tcp", 80);
}

void loop(void) {
  httpServer.handleClient();
  MDNS.update();
}

Debug Messages


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions