Ok, I am having a problem with an HTTP POST attempt I am doing. The process is to take a file that is created by my program and POST it up to a server. My process created the file and POST's it fine but the problem I am having is that I cannot seem to recieve the response back properly. My code just sits in processing constantly and does not give me back a response. I have talked to the person on the other side of the communication and he says that his server is sending me back a response but I just sit in a processing state. HEre is my code and if anyone can assist that would be great.


Private Sub cmdOK_Click()

RunDir = App.Path & "/"

UserID = Text1(3).Text
Password = Text1(4).Text

AL3Data = ""
If Dir(RunDir & "xxx.AL3") <> "" Then
Open (RunDir & "xxx.AL3") For Input As #1
Do Until EOF(1)
Line Input #1, Al3Input
AL3Data = AL3Data & Al3Input
Loop
Close #1
Else
Missingfile = "Missing xxx.AL3 File"
MsgBox Missingfile, vbOKOnly, "Data Bridge Error"
End If

AL3Node = "<AL3Data>" & AL3Data & "</AL3Data>"
InetDone = False

DoEvents

InetURL = "http://www.server.com"

InetInfo = ""
InetInfo = InetInfo & "<UpLoadRequest>"
InetInfo = InetInfo & AL3Node
InetInfo = InetInfo & "<UserId>" & UserID & "</UserId>"
InetInfo = InetInfo & "<UserPswd>" & Password & "</UserPswd>"
InetInfo = InetInfo & "</UpLoadRequest>"


InetHead = "Content-Type: application/x-www-form-urlencoded" ' & vbCrLf

DoEvents

Call URLEncode(InetInfo)

Inet1.Cancel
Inet1.AccessType = icUseDefault
Inet1.Protocol = icHTTP

frmResult.Visible = True
frmLoad.Visible = False

Inet1.Execute InetURL, "POST", InetEncode, InetHead

While Not InetDone
DoEvents
Wend

response = InetReturn
MsgBox Response, vbOKOnly, "Data Bridge Results"
Inet1.Cancel
End
End Sub

Function URLEncode(ByVal InetInfo As String) As String
Dim i As Integer
Dim acode As Integer
Dim char As String

URLEncode = InetInfo

For i = Len(URLEncode) To 1 Step -1
acode = Asc(Mid$(URLEncode, i, 1))
Select Case acode
Case 48 To 57, 65 To 90, 97 To 122
Case 32
Mid$(URLEncode, i, 1) = "+"
Case Else
URLEncode = Left$(URLEncode, i - 1) & "%" & Hex$(acode) & Mid$ _
(URLEncode, i + 1)
End Select
Next

InetEncode = URLEncode
End Function

Private Sub Inet1_StateChanged(ByVal State As Integer)

Dim strData As String 'the complete response

InetState = State
InetResponse = Inet1.ResponseCode & "," & Inet1.ResponseInfo

Select Case State
Case icError ' 11
InetReturn = "Error " & Inet1.ResponseCode & ":" & Inet1.ResponseInfo
InetDone = True
Case icResponseCompleted ' 12
Dim bDone As Boolean: bDone = False
Dim vData As Variant 'a response fragment
InetReturn = ""
vData = Inet1.GetChunk(1024, icString)
DoEvents

Do While Not bDone
strData = strData & vData
vData = Inet1.GetChunk(1024, icString)
DoEvents
bDone = (Len(vData) = 0)
Loop
InetReturn = strData
InetDone = True
End Select

End Sub