I am also looking into posting files to an ASP or CGI script using the
MSInet Control via the HTTP protocol. FTP is not an option for me nor
is using a downloadable control that doesn't have the source with it.
This is due to some of the business rules I must follow.
What I've found so far is that Chin Seng wrote an OCX (CSInet) a few
years ago that uses the MSInet Control. He has it for free download
at his website (http://web.singnet.com.sg/~kegoh/) but however doesn't
provide the source. He also makes note that he uses the RFC 1867
protocol.
So in my attempt to recreate this control I've read the RFC 1867
proposal that I found here http://www.ietf.org/rfc/rfc1867.txt and
began trying to mimic the their examples in VB without success.
Below is a what I think you have to do but it's not working yet, but
maybe someone can see what I've done wrong. Without finding anymore
documentation I'm almost at a stop point. I'm hoping someone could
share some more information.
Regards,
Jared Kirkwood
'-------------
'my code
'-------------
strURL = "http://localhost/uploadfile.asp"
strInputData = "----------------------------7ce323980c" & vbCrLf & _
"Content-Disposition: form-data; name=""name""" & vbCrLf & vbCrLf &
_
"test" & vbCrLf & _
"----------------------------7ce323980c" & vbCrLf & _
"Content-Disposition: form-data; name=""filename"";
filename=""D:\test.txt""" & vbCrLf & _
"Content-Type: application/octet-stream" & vbCrLf & vbCrLf & _
"HI JARED"
strRequestHeader = "Content-type: multipart/form-data;
boundary=--------------------------7ce323980c"
Inet1.Execute strURL, "POST", strInputData, strRequestHeader
Quote:
> >How can I send an HTTP post request in Visual Basic 6.0?
> >Would Msinet.ocx let me do it ? If not , any API or any
> >other way ?
> >Thanks a bunch.
> The Catalyst Development SocketTools Visual Edition contains an HTTP
> ActiveX control that supports POST easily. The product comes with
> many VB samples, including ones that illustrate POSTing through the
> SubmitRequest method. You can download the entire product for a free
> 30-day evaluation from www.catalyst.com
> David
> ----
> Catalyst Development Corporation | application with ActivePatch. Download
> http://www.catalyst.com/ | the SDK from www.activepatch.com