I have to following code in VB6.0, which allows me to post a file using http
post. The code works good, but it works only on the text files. How can
I send Word document files or any other binary files?


Private Sub cmdSubmit_Click()

Dim strText As String
Dim strBody As String
Dim strFileName As String
Dim oHttp As XMLHTTP26 ' add a reference to Microsoft XML, V26 to the

oHttp.open "POST", "http://www.website.com/customerinfo/upload.asp", False
oHttp.setRequestHeader "Content-Type", "multipart/form-data,

'assemble the body. send one field and one file
strBody = _
"--AaB03x" & vbCrLf & _
"content-disposition: form-data; name=""field1""" & vbCrLf & vbCrLf &
"test field" & vbCrLf & _
"--AaB03x" & vbCrLf & _
"content-disposition: form-data; name=""xyz""; filename=""" & strFileName
& """" & vbCrLf & _
"Content-Type: text/plain" & vbCrLf & vbCrLf & _
strText & vbCrLf & _
'send it
'"Content-Type: text/plain" & vbCrLf & vbCrLf
oHttp.send strBody

End Sub