|
서버쪽에서 jsp로 구현된 프로그램과 로컬쪽에서 VB로 구현된 프로그램이 서로 통신을 하여 http방식으로 파일을 upload하려고 합니다.
------------- VB 프로그램 --
Private Sub CmdUpLoad_Click()
Dim inetUpload As Inet
Dim FileContents() As Byte
Dim vFileName As String
Dim header As String
Set inetUpload = New Inet
If inetUpload.StillExecuting = True Then
inetUpload.Cancel
End If
inetUpload.Protocol = icHTTP
vFileName = "C:\CCC.xls"
header = "Authentication: Basic ZHVtbXl1c2VyOmR1bW15cGFzc3dk" & vbCrLf
header = header & "Content-type: multipart/form-data" & vbCrLf
Open vFileName For Binary Access Read As #1
ReDim FileContents(LOF(1))
Get #1, , FileContents
Close #1
With inetUpload
.Document = "/RcvFile.jsp?filename=" & vFileName
.AccessType = icDirect
.RemoteHost = "10.10.10.10"
.URL = .RemoteHost & .Document
.Execute .URL, "POST", FileContents, header
Do While .StillExecuting
DoEvents
Loop
End With
End Sub
이 프로그램으로 file을 upload하기 위한 jsp 프로그램은 어떻게 하면 될까요?
|