How to have app automatically send log file to support?

In order to manage the errors coming from a particular client I am thinking about having the app send the current error log file to me, perhaps when it starts up.

What would the best way to achieve this in a VB6/XP environment?

Email might be easy but I imagine that could fire off all sorts of anti-virus/firewall protections.

Connecting to a webserver might be better. Would the app still have to open up the Windows firewall in this case?


I'm using XMLHTTP to upload clients error logs like this:

Private Sub pvPostFile(sUrl As String, sFileName As String, Optional ByVal bAsync As Boolean)
    Const STR_BOUNDARY  As String = "3fbd04f5-b1ed-4060-99b9-fca7ff59c113"
    Dim nFile           As Integer
    Dim baBuffer()      As Byte
    Dim sPostData       As String

    '--- read file
    nFile = FreeFile
    Open sFileName For Binary Access Read As nFile
    If LOF(nFile) > 0 Then
        ReDim baBuffer(0 To LOF(nFile) - 1) As Byte
        Get nFile, , baBuffer
        sPostData = StrConv(baBuffer, vbUnicode)
    End If
    Close nFile
    '--- prepare body
    sPostData = "--" & STR_BOUNDARY & vbCrLf & _
        "Content-Disposition: form-data; name=""uploadfile""; filename=""" & Mid$(sFileName, InStrRev(sFileName, "\") + 1) & """" & vbCrLf & _
        "Content-Type: application/octet-stream" & vbCrLf & vbCrLf & _
        sPostData & vbCrLf & _
        "--" & STR_BOUNDARY & "--"
    '--- post
    With CreateObject("Microsoft.XMLHTTP")
        .Open "POST", sUrl, bAsync
        .SetRequestHeader "Content-Type", "multipart/form-data; boundary=" & STR_BOUNDARY
        .Send pvToByteArray(sPostData)
    End With
End Sub

Private Function pvToByteArray(sText As String) As Byte()
    pvToByteArray = StrConv(sText, vbFromUnicode)
End Function

Need Your Help

I don't understand how to use delegates in Cocoa but I know what they are

objective-c cocoa

Like many people I'm interested on Objective - C and Cocoa programming. I know conceptually what a delegate it is but I don't understand how to use them or when to use them. Here is some example co...

Pass data in URL without using GET


I have a page that displays information for a selected member. Right now, I choose select the member in the URL using GET data like so: Page/index.php?Member=member1 I see websites that do it lik...