Skip to content

Commit 487a799

Browse files
author
Luc
committed
Use new API from 2.0.0 for file upload
now file upload management is filtered according URI the generic one cannot be overloaded as before but need to be specified
1 parent 77dd4ab commit 487a799

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

esp8266/webinterface.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,10 +2641,6 @@ void WebUpdateUpload()
26412641
yield();
26422642
}
26432643

2644-
void handleFileUpload(){
2645-
if(web_interface->WebServer.uri() == "/FILES") SPIFFSFileupload();
2646-
if(web_interface->WebServer.uri() == "/UPDATE") WebUpdateUpload();
2647-
}
26482644

26492645
void handleUpdate(){
26502646
web_interface->is_authenticated();
@@ -3171,12 +3167,11 @@ WEBINTERFACE_CLASS::WEBINTERFACE_CLASS (int port):WebServer(port)
31713167
WebServer.on("/PRINTER",HTTP_ANY, handle_web_interface_printer);
31723168
WebServer.on("/CMD",HTTP_ANY, handle_web_command);
31733169
WebServer.on("/RESTART",HTTP_GET, handle_restart);
3174-
WebServer.on("/UPDATE",HTTP_ANY, handleUpdate);
3175-
WebServer.on("/FILES", HTTP_ANY, handleFileList);
3170+
WebServer.on("/UPDATE",HTTP_ANY, handleUpdate,WebUpdateUpload);
3171+
WebServer.on("/FILES", HTTP_ANY, handleFileList,SPIFFSFileupload);
31763172
WebServer.on("/SDFILES", HTTP_ANY, handleSDFileList);
31773173
WebServer.on("/LOGIN", HTTP_ANY, handle_login);
31783174
WebServer.on("/PASSWORD", HTTP_ANY, handle_password);
3179-
WebServer.onFileUpload(handleFileUpload);
31803175
//Captive portal Feature
31813176
#ifdef CAPTIVE_PORTAL_FEATURE
31823177
WebServer.on("/generate_204",HTTP_ANY, handle_web_interface_root);

0 commit comments

Comments
 (0)