Sending Multiple files using curl http post fropm a bat file
If you run For %%f in (D:\OrderUploads\company\xmls\*.xml') do echo %%f
you will see the %%f
variable already contains full paths like D:\OrderUploads\company\xmls\dt.xml
so simply don't specify the path in curl
command line:
For %%f in (D:\OrderUploads\company\xmls\*.xml) do ( curl --form upload=@%%f --form press=OK http://gateway.companyname.com:5400/companyGateway)
Alternatively you can use %%~
prefix to extract any part of drive:\path\name.ext
, e.g. %%~nxf
.