I need to post some data from an Excel worksheet to an HTTP web service with VBA. I'm using MSXML2.XMLHTTPServer. How can I track the upload progress in order to give a feedback to the user (e.g. a progress bar)?
Here is the code I use :
Const STR_BOUNDARY As String = "3fbd04f5-b1ed-4060-99b9-fca7ff59c113"
'--- prepare body
PostData = "--" & STR_BOUNDARY & vbCrLf & _
"Content-Disposition: form-data; name=""path""; filename=""" & fileName & """" & vbCrLf & _
"Content-Type: application/octet-stream" & vbCrLf & vbCrLf & _
PostData & vbCrLf & _
"--" & STR_BOUNDARY & "--"
'--- post
objHTTP.Open "POST", Url, False
objHTTP.SetRequestHeader "Content-Type", "multipart/form-data; boundary=" & STR_BOUNDARY
objHTTP.Send pvToByteArray(PostData)
PostString = objHTTP.responseText