Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3641

How to get progress of file upload in percentage

$
0
0

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

Viewing all articles
Browse latest Browse all 3641

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>