mirror of
https://github.com/azaion/annotations.git
synced 2026-04-23 05:16:31 +00:00
add generating result image to Results directory
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
set API_URL=https://api.azaion.com
|
||||
set SOURCE_FILE=%1
|
||||
set DESTINATION=%2
|
||||
|
||||
set "SOURCE_FILE=%SOURCE_FILE:\=/%"
|
||||
|
||||
set EMAIL=uploader@azaion.com
|
||||
set PASSWORD=Az@1on_10Upl0@der
|
||||
|
||||
for /f "tokens=*" %%i in ('curl -s -X POST -H "Content-Type: application/json" ^
|
||||
-d "{\"email\":\"%EMAIL%\",\"password\":\"%PASSWORD%\"}" %API_URL%/login') do set RESPONSE=%%i
|
||||
|
||||
for /f "tokens=2 delims=:" %%a in ('echo %RESPONSE% ^| findstr /i "token"') do (
|
||||
set "TOKEN=%%a"
|
||||
set "TOKEN=!TOKEN:~1,-1!"
|
||||
set "TOKEN=!TOKEN:~0,-2!"
|
||||
)
|
||||
|
||||
set UPLOAD_URL=%API_URL%/resources/%DESTINATION%
|
||||
|
||||
echo Uploading %SOURCE_FILE% to %UPLOAD_URL%...
|
||||
curl --location %UPLOAD_URL% ^
|
||||
-H "Authorization: Bearer %TOKEN%" ^
|
||||
-H "Content-Type: multipart/form-data" ^
|
||||
--form "data=@%SOURCE_FILE%"
|
||||
echo Upload complete!
|
||||
Reference in New Issue
Block a user