Can anyone plz tell me,how to accept request on server side,coming from HttpSendRequest() API(For Http Upload Control in VB).I am posting my code:
I think I need Server side component(may be in ASP),but how to implement it?
Public Function UploadFileHTTP(ByVal localFileName As String, ByVal remoteFileName As String) As Integer
Dim nRet As Integer
Dim bRet, bQueryInfo As Boolean
Dim iRet As Integer
Dim nFileHandle, i As Integer
Dim bData(BUFFER_SIZE - 1) As Byte
Dim leftoversize As Long
Dim blnSendRequest As Boolean
nFileHandle = FreeFile
Dim sBuffer As String * 1024
Dim sBufferLength As Long
sBufferLength = Len(sBuffer)
hRequest = HttpOpenRequest(hConnect, "POST", "/Upload_Signature.asp", "HTTP/1.0", 0, 0, INTERNET_FLAG_NO_CACHE_WRITE, 0)
If hRequest = 0 Then
LastDllErrorInfo 'Call before calling any other dll function
If Not HttpErrorCode = 0 Then
Err.Raise HttpErrorCode, , HttpErrorString
End If
Exit Function
End If
Dim sData As String
sData = GetFileContents(localFileName)
If sData <> vbNullString Then
blnSendRequest = HttpSendRequest(hRequest, vbNullString, 0, sData, Len(sData))
Else
Exit Function
End If
'blnSendRequest = HttpSendRequest(hRequest, vbNullString, 0, localFileName, Len(localFileName))
bQueryInfo = HttpQueryInfo(hRequest, HTTP_QUERY_CONTENT_TYPE, sBuffer, sBufferLength, 0)
UploadFileHTTP = bQueryInfo
Close nFileHandle
InternetCloseHandle hRequest
End Function