Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > ftp help needed urgent please


Reply
 
Thread Tools Display Modes
  #1  
Old 01-28-2003, 12:27 PM
yoyo73
Guest
 
Posts: n/a
Question ftp help needed urgent please


hi all,
i was wondering if any one can help me with my problem.
i am trying to upload a txt file from linux box . for that my vb application runs this function( see below) every 1 minute .
first time when it runs it transfers the file correctly but the rest of the time it transfers the file without any errors but when you look at the file its the same as the one transfered on first attemp( i can tell this because the file on the linux box is constantly evey minute or so , appended with new data). i have deleted this file manually on the win pc but still the next time my application uploads the file it the same old one. i have also checked the file on the linux box , its been updated /appended with new data without any fault.
here is the code i am using.
code---
Private Sub doftp(ipadd As String, UserName As String, Password As String, sourceFileName As String, target As String)
On Error GoTo ftperror
Dim lngINet As Long
Dim lngInetConn As Long
Dim blnrc As Boolean
Dim chdirResult As Variant
Dim res As Boolean
lngINet = InternetOpen("FTP", 1, vbNullString, vbNullString, 0) ' opens internet session
If (lngINet <> 0) Then
lngInetConn = InternetConnect(lngINet, ipadd, 0, UserName, Password, 1, 0, 0) ' opens internet session
chdirResult = ChangeDir(lngInetConn, "/usr/log")
blnrc = FtpGetFile(lngInetConn, sourceFileName, target & "\" & sourceFileName, 0, 0, 1, 0)
If (blnrc) Then
MsgBox (" transfer completed ")
Else
MsgBox (" cannot transfer successfully")
End If
call InternetCloseHandle(lngInetConn)
call InternetCloseHandle(lngINet)
Else
MsgBox ("error in connection")
End If
ftperror:
MsgBox (" error in ftp process")
End Sub
----code end ----
many thanks
yoyo73
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->