Results 1 to 6 of 6

Thread: problem with downloading a file using ftp protocol and winsock control in vb6

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    94

    Angry problem with downloading a file using ftp protocol and winsock control in vb6

    Hi,

    I have written an FTP client using winsock control in vb6.
    Everything goes fine except downloading a file with our intranet server. downloading with other ftp server works fine. but if i download a file from our intranet server, it donwload the file, but the file is not complete. and it will not produce any errors. response is trnanfer complete. I am really struggling to findout what makes this behaviour.

    can anyone please help me..

    Thanking you in advance.

    regards
    praveenp

  2. #2
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    Does this happen with any file on the intranet server, or with just one particular file? If the first: then are you sure the FTP server isn't broke? If the second: are you sure the file itself isn't broke?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    94
    Hi,

    It happens with almost all files with our server. Yes, I am sure that file is not broken. all the files on my server is proper.
    I am not at all getting , why this behaviour happening with intranet server. with other ftp servers on internet it works fine. and other ftp clients with our server works fine too. why not mine..?

    do you have any idea..?
    please help me..

    thanking you

    regards
    praveenp

  4. #4
    Addicted Member
    Join Date
    Feb 2003
    Posts
    237
    there are to many things that it could be for someone to guess

    my advice would be to set a packet sniffer and download some smaller files and then analyze what was actually sent

    after you are sure the data coming from teh server is what
    you expected, make sure your ftp code is handling it right, enter
    debugging code back in, you might even have to have it write out sttistics on data received and length into teh actual file you are downloading to try to dertermine where things are boogering up.

    mabey it is something simple like other servers default to binary mode btu this one defaults to ascii mode and you did not set it specifically

    mabey you are downloading text files from unix server and the ascii mode is not including CRLF

    mabey socket buffer is not flushing and writing final data to file

    mabey subs are not written to handle multiple events and concurrent call stacks by using global variables and multiple events are doing weird things (this could be because on intranet your speeds would be faster than internet so bug like this could happen more often on fast ethernet)

    to many things to guess, you must dig
    Free Code, papers, tools, and more

    http://sandsprite.com

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    94
    Hi

    I tested with 140 KB or text file in binary mode transfer with passive conneciton. when i download normally, it downloads 130 kb and closes. but if I go stepping through debugging, it works fine. in normally, socket close event occouring before finishing data? can anyone please tell me what would be the reason. If I go through debugging it works fine. now i will test with few bigger files.

    regards
    praveenp

  6. #6
    Addicted Member
    Join Date
    Feb 2003
    Posts
    237
    i have had a weird bug with winsock before where after
    the last dataarrival, socketclose would hit before dataarrival finished writing data and there was a file close, careful error handling might alert you to this, otherwise onerror resume next would completly hide it.

    I have also hit a weird bug with winsock where it was liek a buffer was not allowing me full access to its data, I forget exactly what it was, but rember seeing that it was an actual winsock bug...the fix I rember was having to add a doevents in, I am thinking it was before I did a .GetData in data arrival but dont entirly rember...I also think I heard that SP5 version fixed this?

    been a while and couldnt locate the code where It happened to me sorry
    Free Code, papers, tools, and more

    http://sandsprite.com

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