Solved

send file using TCPIP

Posted on 2001-08-22
4
221 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

785 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