Re: Response.body and file content different? - WeOnlyDo Discussion board

Re: Response.body and file content different? (General questions)

by teddy1969, Thursday, September 22, 2005, 13:43 (6800 days ago) @ wodSupport

I would say this is almost impossible, ...

maybe it's a little bug? ;-)

It seems to depend on the order of reading the propertys.

Here's what I wrote:

Dim C1 As String
Dim C2 As String

If ErrorCode = 0 Then

C2 = wodHttp1.Response.Body
C1 = f_ReadFile(wodHttp1.Response.FileName)

If C1 <> C2 Then
MsgBox files are different
Else
MsgBox files are equal
End If

Else
txtResponse.Text = ErrorText
End If

The f_ReadFile function is only a short binary read like this:

FF = FreeFile
Open strFile For Binary Access Read As #FF
C = Space$(LOF(FF))
Get #FF, , C
Close #FF

If you create an EXE and start it, you will get different results on the FIRST TRY. If you click again the button, it will work.

After closing the EXE and restart again, the effect will repeat.

If I exchange the C1/C2 lines like this...

C1 = f_ReadFile(wodHttp1.Response.FileName)
C2 = wodHttp1.Response.Body

...it will work correctly every time.

I can send the complete sample to you if you like.

Teddy


Complete thread: