Results 1 to 10 of 10

Thread: Any way to transfer complete file through Winsock/TCPIP

  1. #1

    Thread Starter
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225

    Red face


    is there any way to transfer whole file in one go ( no matter how much big it is) through Win socket or TCP IP .
    Don't give FTP solution i don't want that.In winsocket
    File has to be broken up for sending data, but i don't want that , any way to send file in one go . Or any other third party control which can transfer file to server from client.
    It should be like , client sends it to server , server should not pull it from client means it should be a client side solution .Any one can help . Any suggestion will be appreciated .

    Chander
    Chander
    Email:[email protected]

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Search VBW, they have such a file transfer sample here (Note: you must send the file in parts)

  3. #3

    Thread Starter
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225

    Lightbulb



    I made a search on VBW but all examples / controls are using break up of files.Any other way to send upload file
    except winsock and ftp . ftp i don't want as two users at same time can not login.

    chander
    Chander
    Email:[email protected]

  4. #4
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908
    You can always uuencode the file before sending it (much like a newsgroup's attachment) though regardless of how you send it, the file _will_ need to be split up. It's just the nature of tcp/ip and the net no way around that unless you set up a direct connect and use a virtual lan, though I think that does it behind the scenes as well. Even back in the old BBS days (Electronic Bulletin Boards before the net came anywhere near into play) you had to split up a file to send it for any type of reliable transfer. It's a fact of life.
    -Excalibur

  5. #5

    Thread Starter
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225

    Exclamation


    my concern is , data should reach complete on server.By spliting up , may be packets doesn't reach sequencially ,
    and file format may be spoil.Second if any packets left around , like if connection is cut or by some other mean ,
    complete transfer wouldn't happen .I want either complete file or nothing . Or first i transfer whole data then write
    on file server ( but it is not possible i think , i have to
    write on server as i will recv data.) like in transferring
    data by spliting up , there is no surity that complete file in proper format will reach there. any suggestion on it ???


    Chander
    Chander
    Email:[email protected]

  6. #6
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Thumbs up

    chander,
    Well, you're not recommended to use WinSock comntrol to send a complete file from 1 terminal to another terminal.

    Because this will involve a lot of coding:[*] You need to send the File name, File size or File path to the remote terminal.[*] You need to read the file block by block (e.g. 4K each time)[*] You need to ensure all the data is completed send before you can proceed to send the next block of data. Normally you can use the SendComplete events in Winsock control.[*] You need to inform the remote terminal about the end of file, so that it can close the downloaded file.

    This may even worst when you try to transfer a file through internet.

    Hope, this can give you some hint.

  7. #7

    Thread Starter
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225

    Question


    ya , but any other way to send data from client to server other than FTP .

    Chander
    Chander
    Email:[email protected]

  8. #8
    New Member
    Join Date
    Nov 2006
    Posts
    6

    Re: Any way to transfer complete file through Winsock/TCPIP

    I dont know if this would help but it shows u how to download via HTTP

  9. #9
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Any way to transfer complete file through Winsock/TCPIP

    Chander, you are asking the impossible.

    There is NO way to send a file in one shot (if the file is less than 4K maybe yes), but ALL data is broken in packets, and there's nothing you can do about it.

    If there are programs that say they send the file in one go, in the backgound/dehind the scenes they still break the data in packets.

    You said that you either want the file to be sent complectly or not at all.
    Well, when the connection is closed, you can simply check if the file is complete, and if it's not, then just delete it.

    This is what my file transfer example does:
    VB - How to send a file using the Winsock control

    It still has to send in packets, as I was saying before, there is nothing you can do about that, either live with it (accept it) or don't send files over internet/network at all, because ANY data that you send/receive is broken is packets.

  10. #10
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Any way to transfer complete file through Winsock/TCPIP

    theres loads of examples here and at pscode.com the all split the file up (unless the file is very small), as log as its coded right it will get there fine and work. You can check that the received file is the same size as the original (programatically), and you can get the MD5 hash of the file, send it to the client and have it validated, this would ensure the file got there exactly as the original. Winsock is fine for file transfer theres millions of examples
    Chris

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