Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > Multi file transfer

Thread Tools Display Modes
Old 03-30-2012, 03:28 AM
jeffrey4u jeffrey4u is offline
Join Date: Dec 2009
Posts: 2
Cool Multi file transfer

Hello seniors n friends
I have a problem and i think this the right place.
I can transfer file from one PC to another with WINSOCK.
What i want to do now is to upload a file so that many users can download
that file in any given time.

Let say is a WINSOCK server-client file transfer
where the server can upload a file for the rest of the clients to download.

Any help?
Reply With Quote
Old 04-03-2012, 12:14 PM
loquin's Avatar
loquin loquin is offline
Google Hound

Retired Moderator
* Guru *
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,398

Probably the simplest way is to install ftp server software on the server.

Otherwise, you'll need to define the protocol to be used. Then, implement that protocol on your client and server applications.

If multiple clients could be downloading at the same time, you will need to have the server provide a file transfer port number to the client for use in transferring the file. To be flexible, I would have the client specify the file name it wants to download. Then, have the listen on that port for the client to initiate the transfer. Q: do you need to provide a directory listing ability? i.e., the client requests a list of files available for download; the server gets a directory listing, formats it for transfer (as a string,) responds with a message containing the data (and crc,) and after the client calculates crc at it's end, replies with ack/nack to signal success/failure.

The winsock server instance reads the specified file, 1 K or so at a time. sends the file chunk, along with a checksum and a chunk length. The client needs to calculate the checksum at completion of the chunk, then ack the server if the file chunk CRC matched the crc sent by the server, or NACK of it didn't.

Finally, after all the individual chunks have been transferred and reassembled at the client end, the file transfer is complete. The server notifies the client of this fact, and waits for response from the client. On receipt of the ack or after a timeout, the port is released.

If you're determined to write your own file transfer routines, I suggest you google the XModem specification (popular BBS file transfer protocol in the 80's,) and implement something similar to this.
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown

Last edited by loquin; 04-03-2012 at 12:31 PM.
Reply With Quote
Old 04-17-2012, 01:56 AM
jeffrey4u jeffrey4u is offline
Join Date: Dec 2009
Posts: 2

thanks a lot man
Reply With Quote

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


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.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
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..