Results 1 to 2 of 2

Thread: help with file transfer through winsock

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Location
    Canberra - Australia
    Posts
    8

    Question

    hi there thanx for coming to my rescue

    i want to transfer files between server/client, and am having trouble. i have seen examples of source code, but am unable to implement it myself. can you PLEASE tell me what to do or tell me where i can find ---->DETAILED<----information on this topic.

    Thanx
    *Waco_Jaco*

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

    Thumbs up

    Hi! Waca_Jaco

    It may not a good pratise to transfer file through Winsock control. Because you may hit some
    resource porblem when the file is fews MegaByte.

    Below is my personal method for file transfer through WinSock.
    Server Application
    1. Open the file in binary
    2. Send all the file information to client application, so that the client can open a new file to save
    all the received data.
    3. Wait for Client application ACK before commence the file transfer.
    4. Read the file content block by block (with 2K or 4K per block)
    5. Send this block of data to client application
    6. Wait till all the data in this block is completed sent.
    7. Wait for ACK from client application before comtinue to send the next block of data.
    8. Send ACK to client to notified the client abt the end of file, so that the client can close the opened file.

    Client Application
    1. Open new file with the given FileName, File Attribute
    2. Send ACK to Server application
    3. Save the received data into the opened file.
    4. Send ACk to Server application or the next block of data
    5. Close the opened file.

    If your application if juz eun on a LAN system perhaps you can try to use the FileCopy method that found in VB.
    It support FileCopy through network as well.

    Cheers!

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