• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

send file using TCPIP

Hi all.
how can I send a file using TCPIP? I need  the command to do this.
Thank you
0
omarmallat
Asked:
omarmallat
1 Solution
 
cwreaCommented:
There are a number of higher level TCP/IP-based protocols that can be used for file transfer, including FTP and HTTP.  Did you have a specific one in mind?
0
 
twilhelmCommented:
This is a piece of the selection of coding using the internet transfer control to ftp a file from one system to another.  This example is transfering from the IFS of as/400 to a PC. (inetget is the internal transfer control that you will need to add to the form.



'Setup Internet transfer control properties from INI
' this will also build the URL property

InetGet.RemoteHost = strIPAddr
InetGet.RemotePort = strPort
InetGet.UserName = strUserName
InetGet.Password = strPassword
 
'Build get  string (directly from as400 file not working
'strGet = "RECV" & " " & str400Lib & "/" _
 '& str400File & " " & strPCFile

'Build get string (retrieve file from 400 folder)
strGet = "RECV" & " " & "/qdls/gbadoc/" & str400File _
& " " & strPCFile

'Strip dir path from strpcfile
lngPos = InStrRev(strPCFile, "\", -1, 1)
If lngPos = 0 Then
strStipFile = strPCFile
Else
lngPos = lngPos + 1
strStipFile = Mid(strPCFile, lngPos)
End If

' Kill strPCFile if exist
If (Dir(strPCFile)) = strStipFile Then
Kill strPCFile
End If

'set off error flag
intError = 0

'Display message screen
frminfo.Show (Modeless)

'Run FTP Command string
InetGet.Execute , strGet
zsWaitForResponse

'Quit FTP Processing
InetGet.Execute , "QUIT"

'Display message box and unload information screen
Unload frminfo
If intError = 0 Then
MsgBox "File Download Complete", vbInformation, "Downloading"
End If

End Sub
Sub zsWaitForResponse()
Do Until Not InetGet.StillExecuting
 DoEvents
If intCount < 25 Then
intCount = intCount + 0.001
frminfo.prgDload.Value = intCount
End If
Loop
'Set progress bar at 100%
If intError = 0 Then
Do While frminfo.prgDload.Value < 97
intCount = intCount + 0.001
frminfo.prgDload.Value = intCount
Loop
End If

End Sub
   


Private Sub cmdExit_Click()
Unload frmSelection

End Sub

Private Sub InetGet_StateChanged(ByVal State As Integer)
 
   
    Select Case State
     Case icResolvingHost '1
       frminfo.lblInformation.Caption = "Verify Host IP Address"
     Case icHostResolved '2
      frminfo.lblInformation.Caption = "Host IP Address Found"
     Case icConnecting ' 3
       frminfo.lblInformation.Caption = "Connecting to Host Computer"
     Case icConnected '4
       frminfo.lblInformation.Caption = "Successful Connect"
     Case icRequesting '5
       frminfo.lblInformation.Caption = "Sending Request"
     Case icError ' 11
       MsgBox "Error Downloading File, Verify Configuration and Naming Convention Information", vbInformation, "Error"
       intError = 1
     End Select
   
             
0
 
kreesCommented:
Please, dont lock the questions
0
 
MoondancerCommented:
If this proposed answer has helped you, please accept it, grade it and close this question.  If it did not, reject it and add comments as to your progress and what else is needed.  If no action is taken here by next week, we'll need to decide this outcome.  Expert input always welcome as well.

Thanks,
Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now