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?

Thanks
Peter
pczurak@bigfoot.com


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
project.


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

'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 & _
"--AaB03x--"
'send it
'"Content-Type: text/plain" & vbCrLf & vbCrLf
oHttp.send strBody

End Sub