Upload files to TC via CURL

This example uploads a file to the TC via CURL.

1. Download CURL http://www.downcc.com/file/290703.html

2. Extract the compression package

Programming language: Java

Source code

Process process=Runtime.getRuntime().exec("cmd.exe /c d:/curl.exe http://localhost:8090/TotalControl/v1/storage?token=9Gs2Bg79TaFSo2U9  -F \"image=@d:/1.bmp\"");
//Upload the image to the TC, pay attention to change the token, curl path, image path
System.out.println(new BufferedReader(new InputStreamReader(process.getInputStream(), "utf-8")).readLine());
	   
process=Runtime.getRuntime().exec("cmd.exe /c d:/curl.exe http://localhost:8090/TotalControl/v1/storage?token=9Gs2Bg79TaFSo2U9  -F  \"apk=@d:/1.apk\"");
//Upload APK to TC, pay attention to change token, curl path, apk path
System.out.println(new BufferedReader(new InputStreamReader(process.getInputStream(), "utf-8")).readLine());
		 
process=Runtime.getRuntime().exec("cmd.exe /c d:/curl.exe http://localhost:8090/TotalControl/v1/storage?token=9Gs2Bg79TaFSo2U9  -F \"script=@d:/1.js\"");
//Upload the script to the TC, pay attention to changing the token, curl path, js path
System.out.println(new BufferedReader(new InputStreamReader(process.getInputStream(), "utf-8")).readLine());