diff --git a/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT32.h b/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT32.h
index 15d227b30..fcf228aad 100644
--- a/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT32.h
+++ b/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT32.h
@@ -2,7 +2,7 @@
// compressed by tools/unishox/compress-html-uncompressed.py
/////////////////////////////////////////////////////////////////////
-const size_t HTTP_HEAD_LAST_SCRIPT32_SIZE = 771;
+const size_t HTTP_HEAD_LAST_SCRIPT32_SIZE = 989;
const char HTTP_HEAD_LAST_SCRIPT32_COMPRESSED[] PROGMEM = "\x30\x2F\x83\xAD\xCE\x46\xB1\x0E\xE9\xDE\x3D\xA6\x77\xF5\x47\xC3\x8C\xEA\x2D\x3E"
"\x09\x81\x8B\x1A\xFA\x8E\x86\xA1\x6F\xE6\x45\xE6\x13\x0E\xB3\xE5\x61\x04\x77\x4F"
"\xBD\xE1\x82\xE8\xEA\x1C\x2E\xAB\x38\xEA\xA6\x6C\xAB\xFB\xB3\xAB\xCC\x26\x1D\x1F"
@@ -16,17 +16,25 @@ const char HTTP_HEAD_LAST_SCRIPT32_COMPRESSED[] PROGMEM = "\x30\x2F\x83\xAD\xCE\
"\x9C\xCF\xB0\x43\xD7\x47\xC2\x3B\xA6\xB1\x0E\xF1\xE0\x11\x76\x41\x67\x76\x8E\xF1"
"\xED\x63\x8E\xE9\xF6\x60\xE5\x9F\x67\x78\x81\x2B\x21\x04\x2C\x5D\x8E\x3B\xA7\xD9"
"\x83\x94\x40\x9B\x68\x10\x73\xD3\xC5\x1D\x0C\x67\xC6\x9D\x3C\x2C\x70\xDD\xA3\xBA"
- "\x77\x8F\x2A\x01\x8B\xC2\x09\x80\xE8\xEE\xD0\x20\xF0\x84\x6C\x3E\x73\x1F\x44\x6C"
- "\x21\xA4\x11\x0A\xAA\x18\x5F\x66\xA1\x6F\xD4\x77\x4E\xF1\xE0\xD8\x74\x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\x87\xD9\x8B\x0B\xCC\xFB\x3B\xDE\x74\x55\xA3\x5E\x0B\xA3\xBA\x77\x4E\xF1\xF0\xFC"
+ "\x04\x4E\x19\x4E\xA3\x9C\xDB\x3B\xC4\x08\x78\x4D\x7C\x5B\x3E\xCE\xF7\x85\x82\x27"
+ "\x10\x08\x16\x75\xA3\x8C\xEF\x1E\xD2\x05\x4C\xD4\xE5\x36\xC8\x10\x78\xB0\x36\x1D"
+ "\x3C\xF8\x43\xBA\x77\x8F\x07\xB8\xF4\x3B\x3C\x1F\xF4\x65\x1F\x86";
#define HTTP_HEAD_LAST_SCRIPT32 Decompress(HTTP_HEAD_LAST_SCRIPT32_COMPRESSED,HTTP_HEAD_LAST_SCRIPT32_SIZE).c_str()
\ No newline at end of file
diff --git a/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT32.h b/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT32.h
index 1b651cc52..3b8a1ebff 100644
--- a/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT32.h
+++ b/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT32.h
@@ -25,9 +25,27 @@ const char HTTP_HEAD_LAST_SCRIPT32[] PROGMEM =
"eb('f2').style.display='block';"
"t.form.submit();"
"}"
+ "function upl(t){" // check file's first byte to decide next step
+ "var sl=t.form['u2'].files[0].slice(0,1);" // load only first byte of file
+ // "console.log(sl);"
+ // "console.log(sl.length);"
+ "var rd=new FileReader();"
+ "rd.onload=()=>{"
+ // "console.log(\"rd.onload\");"
+ "var bb=new Uint8Array(rd.result);"
+ // "console.log(bb[0]);"
+ // "console.log(bb.length);"
+ "if(bb.length==1&&bb[0]==0xE9){"
+ "fct(t);" // upload via factory
+ "}else{"
+ "t.form.submit();" // normal upload
+ "};"
+ "};"
+ "rd.readAsArrayBuffer(sl);"
+ "return false;"
+ "};"
+
"function fct(t){"
- // "console.log('running fct');"
- // "console.log(t);"
"var x=new XMLHttpRequest();"
"x.open('GET','/u4?u4=fct&api=',true);"
"x.onreadystatechange=()=>{"
@@ -43,6 +61,5 @@ const char HTTP_HEAD_LAST_SCRIPT32[] PROGMEM =
"};"
"x.send();"
// "console.log('after send');"
- "return false;"
"}"
"";
diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino
index 3b129e3c6..683dc0b00 100644
--- a/tasmota/xdrv_01_webserver.ino
+++ b/tasmota/xdrv_01_webserver.ino
@@ -354,17 +354,17 @@ const char HTTP_FORM_RST_UPG[] PROGMEM =
"
"
""
""
- "