I have prepared a code sample that allows me to send a series of parameters along with a file to an API address like https://aaa.com/api/token/sendfile. I have used MSXML2.XMLHTTP in the project, but I still don't know how to get the percentage of the file being uploaded. Does anyone have an example?(It's OK if it works with winhttp or other ways, too.)
Here is simple code to explain what I am trying to do:
Dim RetVal As ObjectSet RetVal = CreateObject("MSXML2.XMLHTTP")RetVal.Open "POST", "https://aaa.com/api/token/sendfile", falseRetVal.SetRequestHeader "User-Agent", "aaa"v.SetRequestHeader "Content-Type", "multipart/form-data; charset=utf-8; boundary=" & STR_BOUNDARYRetVal.SetRequestHeader "Content-Length", xsizeRetVal.Send custombytedatavResult = RetVal.ResponseText