     filename = "/payloads/"+filename;
 //    Serial.print("Uploading file "); 
 //    Serial.print(filename+" ... ");
-    String truncatedname = filename.substring(0,20);
+    String truncatedname = filename.substring(0,31);
     fsUploadFile = SPIFFS.open(truncatedname, "w");
     filename = String();
   }

#include <ESP8266mDNS.h>
#include <FS.h>
#include <ArduinoJson.h> // ArduinoJson library 5.11.0 by Benoit Blanchon https://github.com/bblanchon/ArduinoJson
#include <ESP8266FtpServer.h> // https://github.com/apullin/esp8266FTPServer/tree/feature/bbx10_speedup
//#include <SoftwareSerial.h>
//#include <DoubleResetDetector.h> // Double Reset Detector library VERSION: 1.0.0 by Stephen Denne https://github.com/datacute/DoubleResetDetector


  }
// or Join existing network
  else if (accesspointmode != 1) {
    WiFi.disconnect(true);
    WiFi.mode(WIFI_STA);
//    Serial.print("Setting up Network Configuration ... ");
