Dim j As HttpJob
j.Initialize("", Me)
Dim fd As MultipartFileData
fd.Initialize
fd.Dir = File.DirAssets
fd.FileName = "08052019080800.tcx"
fd.KeyName = Null
fd.ContentType = "text/xml"
Log("Exists: " & File.Exists (fd.Dir, fd.FileName))' check the file is there, it is
j.PostMultipart("https://www.strava.com/api/v3/uploads", CreateMap("activity_type": "ride","name": "08052019080800", "data_type": "tcx"), Array(fd))
'header needed for authorization
Dim bearer As String = "Bearer " & newtoken
Log ("header = " & bearer)
j.GetRequest.SetHeader("Authorization", bearer)
Wait For (j) JobDone(j As HttpJob)
j.GetString
Log("waiting for job done " & j.GetString)
If j.Success Then
Log("success")
Else
Log(j.ErrorMessage)
End If