Page 1 of 2 12 LastLast
Results 1 to 40 of 54

Thread: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

  1. #1

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Resolved [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    As the topic says..
    Is there any way to use one of those 2 controlers to upload files to ftp?

    Also would be great if there exists some module/class for MsInet

    I didn't wanted to use ocx files in this ftp client.
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    The attached ZIP file contains a bunch of classes I wrote a few years back that you can use for FTP. Even though it contains 5 classes and one module and you'll have to add them all to your project, you only create one object (an instance of CFtp). Here's how to use it (please read the comments below):
    VB Code:
    1. Private [b]WithEvents [/b]oFTP As CFtp
    2.  
    3. Private Sub Form_Load()
    4.     Set oFTP = New CFtp
    5.     'All arguments to the Connect method is optional
    6.     'you can set them via properties instead
    7.     oFTP.Connect "ftp.mysite.com", "username", "password"
    8.     ' Set the TransferType property to determent how a file
    9.     ' is transfered as ASCII (converts newlines) or as Binary
    10.     oFTP.TransferType = FTP_TRANSFER_TYPE_ASCII 'or FTP_TRANSFER_TYPE_BINARY
    11.     ' The UploadFile raises events while uploading
    12.     ' but the call will still not return until its done.
    13.     ' You can however cancel the transfer in the TransferProgress
    14.     ' event if you like by setting the CancelProperty to True
    15.     oFTP.UploadFile "c:\myfile.txt", "newfile.txt"
    16.     ' You can also use the PutFile method to upload a file,
    17.     ' however this method does not raise any events and does not
    18.     ' give you the option to cancel the transfer:
    19.     'oFTP.PutFile "c:\LocalFile.txt", "RemoteName.txt"
    20.    
    21.     ' To download a file simply use the DownloadFile method
    22.     ' if you want the events to fire or the GetFile method if
    23.     ' you are not interested in the progress.
    24.     '
    25.     ' The following shows how you can list the files in the current
    26.     ' remote directory into a listbox.
    27.     Dim oFile As CFtpFile
    28.     ' First argument:  File pattern (use * instead of *.* on Unix/Linux)
    29.     ' Second argument: (Optional) NoCache
    30.     oFTP.ListDir "*", True '<- Second argument (optional): NoCache
    31.     For Each oFile In oFTP.Files
    32.         If oFile.IsDirectory Then
    33.             List1.AddItem "[" & oFile.FileName & "]"
    34.         Else
    35.             List1.AddItem oFile.FileName
    36.         End If
    37.     Next
    38.     ' The CFtp class has a bunch of other method and properties such as
    39.     ' MakeDir, ChangeDir, DeleteDir, DeleteFile, FileExist, GetCurrDir
    40.     ' .. and so on
    41. End Sub
    42.  
    43. Private Sub oFTP_ErrorMsg(ByVal sErr As String)
    44.     'Error messages
    45.     Debug.Print "Error: " & sErr
    46. End Sub
    47.  
    48. Private Sub oFTP_StatusMsg(ByVal Msg As String)
    49.     'different status messages
    50.     Debug.Print Msg
    51. End Sub
    52.  
    53. Private Sub oFTP_TransferCompleted()
    54.     'a download/upload is completed
    55. End Sub
    56.  
    57. Private Sub oFTP_TransferProgress(ByVal nPercent As Long, _
    58.  ByVal fBytesReceived As Double, ByVal fFileSize As Double)
    59.     'You can use this event to update a progress bar or
    60.     'to give some other feedback to the user about the
    61.     'download/upload progress.
    62. End Sub
    Attached Files Attached Files

  3. #3

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    KO!!
    Awsome work you have donne!

    The only doubt i have is how do you close the connection. Or will it timeout?
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    No, it will not timeout by itself, however the server might close an inactive connection after X number of minutes. However you should do it by calling the CloseConnection method.
    VB Code:
    1. oFTP.CloseConnection

  5. #5

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    I wonder how didn't see that :\
    My bad, i should have more attention when reading
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  6. #6

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Is there any way to make the the oftp wait till the upload is donne?
    like with inet.stillexecuting
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  7. #7
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Create your own boolean variable, for example blnFTPExecuting, and set it to True when you start an upload or download. Then reset it to False in the TransferCompleted event.... Or, if you're not interested in the events use the PutFile function instead, that will not return until the file is uploaded, but you can of course in that case not show any progress either.
    Last edited by Joacim Andersson; Apr 15th, 2006 at 07:19 AM.

  8. #8

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    thanks for the tip
    working and runing now as it should
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  9. #9
    Lively Member
    Join Date
    Jan 2006
    Posts
    70

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Is there a way to do this on a different port? Would I just do it like this?

    oFTP.Connect "ftp://mrtikki2.no-ip.org:2121", "Username", "Password"

  10. #10
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    You'll need to make a slight change to the Connect method to allow that.

  11. #11
    Lively Member
    Join Date
    Jan 2006
    Posts
    70

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Public Function Connect(Optional RemoteHost As String, Optional UserName As String, Optional Password As String, Optional nPort As String, Optional ProxyName As String) As Boolean


    I got it.. thanks for the advice!

  12. #12
    Lively Member
    Join Date
    Jan 2006
    Posts
    70

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Alright, now I'm having a little bit of trouble with the send file.. I'm running a personal ftp client and I'm allowing people to send files to me. I see myself connect, but it disconnects very fast and doesn't send the file. Here's my code. Thanks for the help.

    File = Format(Date, "mm.dd.yy") & " ~ " & Format(Time, "hh.mm.ss")
    Set oFTP = New CFtp
    oFTP.Connect "mrtikki2.no-ip.org", "Username", "Password", "2121"
    oFTP.TransferType = FTP_TRANSFER_TYPE_BINARY
    oFTP.UploadFile "c:\" & File & ".txt", File & ".txt"
    End Sub

    Private Sub oFTP_TransferCompleted()
    'oFTP.CloseConnection
    'Unload Form1
    End Sub

    I've tried binary and ascii

  13. #13
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    The CFtp class doesn't disconnect from the server unless you call the CloseConnection method, so it must be your FTP server that closes the connection.

  14. #14
    Lively Member
    Join Date
    Jan 2006
    Posts
    70

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    ooo got it.. there was a folder called Uploads it has to go in first

    Thank you.. this is an amazing file.. 10/10

  15. #15
    Lively Member
    Join Date
    Jan 2006
    Posts
    70

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocke

    Private Sub oFTP_TransferCompleted()
    MsgBox "worked"
    oFTP.CloseConnection
    Unload Form1
    End Sub

    How come when I send a file.. I dont get the messagebox when it's done sending?

    EDIT:: Also, I can ftp files to myself fine using it... but nobody else can ftp to it. Here's my log.

    Here's anyone else.

    VB Code:
    1. Mon Apr 17 18:12:20 2006  58  Incoming connection request on interface 192.168.1.10
    2. Mon Apr 17 18:12:20 2006  58  Connection request accepted from 68.62.187.254
    3. Mon Apr 17 18:12:20 2006  58  USER Test
    4. Mon Apr 17 18:12:20 2006  58  331 User Test, password please  
    5. Mon Apr 17 18:12:20 2006  58  PASS ***********
    6. Mon Apr 17 18:12:20 2006  58  230 Password Ok, User logged in  
    7. Mon Apr 17 18:12:20 2006  58  TYPE I
    8. Mon Apr 17 18:12:20 2006  58  200 Type Binary  
    9. Mon Apr 17 18:12:20 2006  58  PORT 192,168,1,100,7,188
    10. Mon Apr 17 18:12:20 2006  58  200 Port command received  
    11. Mon Apr 17 18:12:20 2006  58  STOR /uploads/AIM/04.17.06 ~ 17.12.22.txt
    12. Mon Apr 17 18:12:21 2006  58  Unable to Connect : The operation completed successfully.  
    13. Mon Apr 17 18:12:21 2006  58  425 Unable to open the data connection  
    14. Mon Apr 17 18:12:22 2006  58  The connection was closed by the remote socket.
    15. Mon Apr 17 18:12:22 2006  58  Connection terminated.

    And here's me.

    VB Code:
    1. Mon Apr 17 18:06:24 2006  51  Incoming connection request on interface 192.168.1.10
    2. Mon Apr 17 18:06:24 2006  51  Connection request accepted from 192.168.1.1
    3. Mon Apr 17 18:06:24 2006  51  USER Test
    4. Mon Apr 17 18:06:24 2006  51  331 User Test, password please  
    5. Mon Apr 17 18:06:24 2006  51  PASS ***********
    6. Mon Apr 17 18:06:24 2006  51  230 Password Ok, User logged in  
    7. Mon Apr 17 18:06:24 2006  51  Anonymous user "AIM" logged in with password "AIM"
    8. Mon Apr 17 18:06:24 2006  51  TYPE I
    9. Mon Apr 17 18:06:24 2006  51  200 Type Binary  
    10. Mon Apr 17 18:06:24 2006  51  PORT 192,168,1,10,18,159
    11. Mon Apr 17 18:06:24 2006  51  200 Port command received  
    12. Mon Apr 17 18:06:24 2006  51  STOR /uploads/AIM/04.17.06 ~ 18.06.24.txt
    13. Mon Apr 17 18:06:24 2006  51  150 Opening data connection  
    14. Mon Apr 17 18:06:24 2006  51  File transfer complete
    15. Mon Apr 17 18:06:24 2006  51  226 Transfer complete  
    16. Mon Apr 17 18:06:31 2006  51  The connection was closed by the remote socket.
    17. Mon Apr 17 18:06:31 2006  51  Connection terminated.

    Any ideas?

    EDIT#2:: I had my friend connect to my ftp server using flashfxp with the same user and pass, and they could upload fine.. So I do not believe it is a problem with my server.

    EDIT#3:: I was wondering, does this use passive or no?
    Last edited by SC I VeNoM I; Apr 17th, 2006 at 06:25 PM.

  16. #16
    Lively Member
    Join Date
    Jan 2006
    Posts
    70

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Would it be hard to put passive connections in this?

  17. #17
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Quote Originally Posted by SC I VeNoM I
    Would it be hard to put passive connections in this?
    Yes, pretty hard... What you need to do is to set the PassiveSementic property of the CFtp class to True... Oh yeah, on second thought that wasn't very hard

  18. #18
    Lively Member
    Join Date
    Jan 2006
    Posts
    70

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Lol, sorry, but how would I do this? This is what I've tried

    Public Function Connect(Optional RemoteHost As String, Optional UserName As String, Optional Password As String, Optional nPort As String, Optional PassiveSementic As Boolean, Optional ProxyName As String) As Boolean

    I've changed that.

    oFTP.Connect "mrtikki2.no-ip.org", "username", "password", "2121", True

    and theres how i connect... what did i miss?

  19. #19
    Lively Member
    Join Date
    Jan 2006
    Posts
    70

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    haha the obvious...

    PassiveSementic = True

    at the beginning of the class did the trick lol

    Thank you so much.. remind me next time.. i owe you a dollar

    Cheers!

  20. #20

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Joacim Andersson, did you notice any problem while connecting to some ftps?
    It worked great inside the network, but for outside ftps it didn't work always.
    Any clue why would this happen?
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  21. #21
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    I've never had any problems connecting to any FTP server, unless of course the server uses SFTP which is a whole other thing. If you have problems you should check your firewall settings.

  22. #22
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Hi Joacim, Im using the classes you attached here.

    I'm trying to create an app that will update the FTP files according to local files (it makes a backup of a folder content), but it should just upload files when they are new. I thought about using the file date, if its newer than the file in the FTP it should upload, else not. But: FTP files always have the date when they were uploaded, not modified, so this logic is not valid.
    Then the question: How would you know when the file is exactly the same so it shouldn't be uploaded again?

    Thanks

  23. #23
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Well, checking the dates should still work. If a local file is newer than the file on the server it must have been changed since it was last uploaded. You could also keep a log file that stores the date/time of the local file before it uploads it and simply compare the log entry against the current date/time of the local file. If it's newer it should be uploaded again.

  24. #24
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Quote Originally Posted by Joacim Andersson
    Well, checking the dates should still work. If a local file is newer than the file on the server it must have been changed since it was last uploaded.
    Doh!.. you're right, Thanks Joacim.

  25. #25
    New Member
    Join Date
    Dec 2006
    Posts
    5

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Dear Joacim Andersson,
    The internal error occured when transmit the filename called(C:\PruCallListStatus_ByCSR_2006-12-27.csv.pgp). How can I resolve it using your lib? Could you tell me?

    Regards,
    kzyo

  26. #26
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    This happends when using Uploadfile method? what's the error? Did you use oFTP_ErrorMsg event to see whats the error description?

  27. #27
    New Member
    Join Date
    Dec 2006
    Posts
    5

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Dear cjis,
    I have fixed the problem of my program. Thank you so much for your help!
    Regards,
    kzyo

  28. #28
    Member
    Join Date
    Jul 2006
    Posts
    51

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    I am using the code and examples you supplied Joacim.
    I am trying to get a progress bar to show the progress of the upload of a file to the ftp site.

    Please supply me with code on this one.

  29. #29
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Simply use the TransferProgress event to update the progress bar.
    vb Code:
    1. Private Sub oFTP_TransferProgress(ByVal nPercent As Long, _
    2.  ByVal fBytesReceived As Double, ByVal fFileSize As Double)
    3.     'You can use this event to update a progress bar or
    4.     'to give some other feedback to the user about the
    5.     'download/upload progress. For example:
    6.     ProgressBar1.Value = nPercent
    7. End Sub

  30. #30
    Member
    Join Date
    Jul 2006
    Posts
    51

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Ok thanks, but where do I get nPercent from?
    Where / how do I calculate that?

  31. #31
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    nPercent is one of the arguments passed to the event:
    Private Sub oFTP_TransferProgress(ByVal nPercent As Long, _
    ByVal fBytesReceived As Double, ByVal fFileSize As Double)

  32. #32
    Member
    Join Date
    Jul 2006
    Posts
    51

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    I understand that, but I want to know how to calculate that nPercent so that when I use it in the progress bar, the progress bar would actually show the correct progress of the file being uploaded.

    Please supply examples as well.

  33. #33
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    vb Code:
    1. Private Sub Form_Load()
    2.     Me.ProgressBar1.Min = 0
    3.     Me.ProgressBar1.Max = 100
    4. End Sub
    5.  
    6. Private Sub oFTP_TransferProgress(ByVal nPercent As Long, _
    7.     ByVal fBytesReceived As Double, ByVal fFileSize As Double)
    8.    
    9.     'You can use this event to update a progress bar or
    10.     'to give some other feedback to the user about the
    11.     'download/upload progress.
    12.    
    13.     Me.ProgressBar1.Value = nPercent
    14.     DoEvents
    15. End Sub

  34. #34
    Member
    Join Date
    Jul 2006
    Posts
    51

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Ok is that all?
    So I don't need to calculate nPercent (that I must pass to oFTP_TransferProgress) in any way?

  35. #35
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    You don't pass anything to oFTP_TransferProgress since this is an event that is called by the class automatically when you upload/download a file.

  36. #36
    Member
    Join Date
    Jul 2006
    Posts
    51

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Thank you very much!!!

    You have no idea how much this will help me!!!

    Thanks again!

  37. #37
    New Member
    Join Date
    Apr 2007
    Posts
    4

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Hi Joacim,
    I'm itaian programmer and excuse me for my bad english.

    I've a problem with DownloadFile method of your beautiful class.

    nPercent = CLng(fBytesReceived / fFileSize * 100) --> error division by zero

    Because in those row of DownloadFile method :

    For Each f In Me.Files
    If f.FileName = RemoteFile Then
    fFileSize = f.FileSize
    Exit For
    End If
    Next

    fFileSize is NOT valorized.

    How to resolve ?

  38. #38
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Use this line instead:
    VB Code:
    1. If fFileSize Then nPercent = CLng(fBytesReceived / fFileSize * 100)
    This way, if fFileSize = 0 it won't execute and there won't be a Division by 0 error.

  39. #39
    New Member
    Join Date
    Apr 2007
    Posts
    4

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Quote Originally Posted by jcis
    Use this line instead:
    VB Code:
    1. If fFileSize Then nPercent = CLng(fBytesReceived / fFileSize * 100)
    This way, if fFileSize = 0 it won't execute and there won't be a Division by 0 error.
    Ok, but the informarmation about the download progress is not avaible.
    This is the problem.

  40. #40
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: [RESOLVED] Possible to download/upload files into FTP using WinSock 2.0 or CSocket ?

    Quote Originally Posted by moskyow
    Ok, but the informarmation about the download progress is not avaible.
    This is the problem.
    The info about the Download/Upload progress is raised to the Form where CFtp is declared, you can get the progress in this Form event:
    Code:
    Private Sub oFTP_TransferProgress(ByVal nPercent As Long, _
        ByVal fBytesReceived As Double, ByVal fFileSize As Double)
        
        'You can use this event to update a progress bar or
        'to give some other feedback to the user about the
        'download/upload progress.
        
        Me.ProgressBar1.Value = nPercent
        DoEvents
    End Sub

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width