Solved

send file using TCPIP

Posted on 2001-08-22
4
216 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
Comment Utility
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
Comment Utility
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
Comment Utility
Please, dont lock the questions
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now