Page 1 of 1

ESP data Upload bat file for windows users

Posted: Thu Feb 19, 2026 10:12 am
by mart1n
Hello, I'm sharing a .bat file for uploading the ESP data folder. It’s intended for those working on Windows who struggle with the Arduino IDE data upload or the .sh file available in Johannes' Git repository.

It works well for me — even better than the arduino-esp8266fs-plugin.

Code: Select all

@echo off
setlocal enabledelayedexpansion

REM Проверка на броя аргументи
if "%~1"=="" (
    echo This tool will send either one, or all data files to the web interface
    echo.
    echo Syntax: %~nx0 ^<hostname or IP address^> [^<path to a file^>]
    exit /b 255
)

if not "%~3"=="" (
    echo This tool will send either one, or all data files to the web interface
    echo.
    echo Syntax: %~nx0 ^<hostname or IP address^> [^<path to a file^>]
    exit /b 255
)

set IP=%~1
echo Uploading to %IP%

REM Ако има втори аргумент – ползваме него, иначе ./data/*
if not "%~2"=="" (
    set FILES=%~2
) else (
    set FILES=.\data\*
)

for %%F in (%FILES%) do (
    echo Sending: %%F
    curl -F "data=@%%F;filename=%%~nxF" http://%IP%/edit
)

endlocal
Copy the code above into a plain text file and save it in the parent directory of the data folder as upload.bat.

Then open the Windows Command Prompt and execute it like this: path to the bat file/upload.bat 192.168.4.1

@Johannes feel free to add it to the repo.