Solved

send file using TCPIP

Posted on 2001-08-22
4
226 Views
Last Modified: 2012-08-14
Hi all.
how can I send a file using TCPIP? I need  the command to do this.
Thank you
0
Comment
Question by:omarmallat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Expert Comment

by:cwrea
ID: 6414812
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
 

Accepted Solution

by:
twilhelm earned 50 total points
ID: 6415146
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
 
LVL 1

Expert Comment

by:krees
ID: 6415615
Please, dont lock the questions
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6697175
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question