# VBForums CodeBank > CodeBank - Visual Basic 6 and earlier >  VB - How to send a file using the Winsock control

## CVMichael

I made 2 projects: ClientSend and ServerReceive

You can send files of ANY size with this (well actually any file less than 2GB).

First start the Server program, click on the "Start Listening for Connections" button.
Then start the client, choose a file you want to transfer, then click on "Send File"

The server supports multiple connections, so you can open more than one Client application and transfer more than one file.
Both of them show the progress of the transfer.
The server saves the files in its App.Path directory.

I tried to make it as simple as possible, and I did not put any comments.
I have a few comments, but that's because I copied and pasted some code from my other applications.

Anyways... enjoy... and I hope you learn something from it.

----------


## DrGonzo

Hi, the speed seems to be limited to 256 KB/s. How could we increase the speed??

----------


## CVMichael

Try increasing the packet size in the client, the first line in the form:

VB Code:
Private Const PacketSize As Long = 1024 * 4
That is 4K per packet, make it 8 or 16 (or even more)

By the way, you have an internet connection that is THAT fast ? must be a T1 or something... I wish I had my internet that fast...

----------


## BrendanDavis

> Try increasing the packet size in the client, the first line in the form:
> 
> VB Code:
> Private Const PacketSize As Long = 1024 * 4
> That is 4K per packet, make it 8 or 16 (or even more)
> 
> By the way, you have an internet connection that is THAT fast ? must be a T1 or something... I wish I had my internet that fast...


I have a cable modem and I've uploaded as fast as 500+ kb/s, downloaded as fast as 1.5+ mb/s. It's not that uncommon, as far as I know.

----------


## CVMichael

Yea, I have cable modem too but it's 128 K*Bits* / second Upload and 1 M*Bit*/second download.

If you notice the values are in Bits, so you have to divide by 8 to get Bytes...
So really it's 16 KBytes/second upload, and 128KBytes/second download.

My program shows the speed in K*Bytes* / second...

----------


## DrGonzo

You have 1 Mbit/s. 256KB/s is just the double of yours...

Yeah, thats right. Today almost everyone in a "1st-world country"   :Cry:   has got at least DSL.
Actually i have unfortunately just 384 kbit/s (48 KB/s) because my (DS)-Line is much too long (over 50 db). That really isn't fast. 
I reached the 256 KB/s on my local Computer.

Watch it yourself:

----------


## CVMichael

That is *KBytes*/Second, so you reached 1984 KBytes / second that is 31,744 KBits / second !!!!

*The program shows the speed in KBytes / second !*

You divided KBytes by 8, but it already shows in KBytes...

----------


## CVMichael

And by the way, about this:

VB Code:
Private Const PacketSize As Long = 1024 * 31
You are wondering why you cannot multiply by 32 ?
That's because 1024 is taken as Integer by the compiler, and 32 is also an integer, so if you multiply them together you also get integer type, but you get an overflow error, right ?

The solution is simple, comvert the numbers to Long type, like this:

VB Code:
Private Const PacketSize As Long = 1024[B]&[/B] * 64[B]&[/B]  ' 64 KBytes buffer
Or if you just type in the total number (multiplied), then it will automatically convert it to long type

VB Code:
Private Const PacketSize As Long = 65536  ' 64 KBytes buffer

----------


## DrGonzo

> That is *KBytes*/Second, so you reached 1984 KBytes / second that is 31,744 KBits / second !!!!
> 
> *The program shows the speed in KBytes / second !*
> 
> You divided KBytes by 8, but it already shows in KBytes...


No, I divided nothing.  :Smilie: 
1984/8= 248, My speed at the beginning was 256 Kbyte/s

 :Roll Eyes (Sarcastic):   :big yellow:  

The picture shows the speed AFTER my modification. 
Before, the speed was 2048 Kilobit/s = *256 Kilobyte/s*  = 0,256 Megabyte/s = 0.000256 Gigabyte/s. Just to make sure that i know these things.  :Smilie: 

The hint with the "&" works fine! But the speed won't go over 10.000 kbyte/s

----------


## CVMichael

OMG, you have to learn your limits.... first of all, how on earth could you send 10 MBytes / second on a real internet connection ? Why would you want to transfer a file from your comptuer to the same comptuer using Winsock.... why not just copy & paste the file the regular way ?

And also, you said it won't go over 10 MBytes / sec ? well, do this:
Copy a file from a directory to another (on the same hard drive), and the speed won't be much faster than that...
The hard drive has to read 10 MBytes / second, and it has to write the same 10 MBytes back to the same hard drive, so your computer has to handle 20 MBytes / second !

Stop testing this on a local computer, and use a real internet connection ! and then you don't need to make the buffer that big because it cannot transfter that much anyways because of internet limitations....

----------


## DrGonzo

I've just tested the program. I'm now not going to use it for any file i will copy on my computer.   :Ehh:  
Did i anoy you with any of the above written? English isn't my mother tongue.

 :wave:

----------


## CVMichael

The program is supposed to be used for transfering files over the internet (or network)...

Yea, you got me a little anoyed... but it's OK... from your previous screen shot, I see you are from Germany (or maybe I got it wrong ?)

----------


## DrGonzo

Yes I'm from germany. Could you please write into a PM what was the annoying part...? thx

----------


## brian.sykes

I get the runtime error 70 which is Permission denied on this line of code


VB Code:
Open App.Path & "\" & Clients(Index).FileName For Binary Access Write Lock Write As Clients(Index).FileNum

Any idea's?

It's on frmReceive, the file server under the DataArrival Sub

----------


## CVMichael

If it's a Permission denied error, then there is nothing I can do/change in the program to fix that... only you can, by setting the appropriate permissions to the directory where you have the application

----------


## BrendanDavis

> Yea, I have cable modem too but it's 128 K*Bits* / second Upload and 1 M*Bit*/second download.
> 
> If you notice the values are in Bits, so you have to divide by 8 to get Bytes...
> So really it's 16 KBytes/second upload, and 128KBytes/second download.
> 
> My program shows the speed in K*Bytes* / second...


You have one slow cable modem, then  :Confused:  I topped mine out downloading off a good server at just over 2mb/s. I downloaded a 20 MB file in less than 10 seconds, in other words.

----------


## CVMichael

> You have one slow cable modem, then  I topped mine out downloading off a good server at just over 2mb/s. I downloaded a 20 MB file in less than 10 seconds, in other words.


How much do you pay per month ?

I can choose to have higher speed from my provider if I pay more (of course), I think the highest is about the speeds you just mentioned, but is aproximatelly $60 (Canadian $) here. Now I'm paying $30 per month.

----------


## evan29

Hey I've modified your code and it became more effective in sending. you don't need to increase packet size to send faster. I've disabled the timer and found a workaround. Replace your SendComplete event with this:


VB Code:
Private Sub SckSendFile_SendComplete()
    
    'Finish off the send complete first with DoEvents, then immediately send the data
    DoEvents
    Call tmrSendFile_Timer 'Send the data
    
End Sub

It have just used "DoEvents" rather than the timer. You should find that it sends a lot faster on fast networks like LAN (not limited to 256 KB/s) and does not need a timer. It should be only slightly faster over slower connections. The "DoEvents" really did work well for me.

----------


## DrGonzo

Hi! 

I just wanted to say that nowadays in big cities for example here in germany like cologne or stuttgart VDSL with an effective download data rate of 50 Mbit/s (that are 6,25 Mb/s) and an upload data rate of 10 Mbit/s are very common. These cost 50 euro or 75 C $.  :big yellow:   :Thumb:  

But even in german villages you can get ADSL or even ADSL2 and ADSL2+ with data rates up to 25 Mbit/s (3,125 Mb/s).

----------


## Pedromiba

but this program of the one to send of a person for the other??? 
What are in different places???
Please they answer.

----------


## CVMichael

> but this program of the one to send of a person for the other??? 
> What are in different places???
> Please they answer.


What ?  :Confused:  

I need a translator to propper English here...

----------


## Pedromiba

I'm sorry i don't speak English very well!! LOL
I with the presented program can send filing-cabinets for other people?

----------


## CVMichael

"filing-cabinets" ??

If those "filing-cabinets" are *files*, then I don't see the problem... the program sends any file, regardless of the type

----------


## Pedromiba

my problem is not this. my problem is: 
with this program, I can send filing-cabinets of a computer for another one??

----------


## Pedromiba

filing-cabinets = Files

----------


## Pedromiba

my problem isn't that. my problem is :
""with this program can i send files of a computer for another one??"

----------


## CVMichael

Yes you can...  did you actually try it ?

But please don't post every minute, you can edit your posts, and make corrections if you need to.

----------


## Pedromiba

I try.
but i can't send files for other pc's.
how i do this????

----------


## CVMichael

Let's say you are a car repair man, and someone comes to you and tells you fix my car, it does not work... will you know what to fix ? will you know where to even start checking ?
But if if he tells you that the back right lights are not working, then you know where to start looking for problems, right ?

So... if you just tell me "i can't send files", how do you think I'll know where the problem is ?
And besides that... programs don't work the same way on every computer... a lot of things can iterfere with the program, firewall, router, antivirus, operating system, etc...

What did you try ?
What works, and what does not work ?
Tell me something usefull !

If you continue to ask for help like this... then it will take a hell of a lot of time to get your problem solved !

----------


## rack

Just wondering, why is your file size for the program limited to 2gb?  I know I would never download or transfer that much, I'm just wondering.

----------


## CVMichael

Because it's using a Long data type to keep track of stransfer size.

A long has a maximum of 2 GBytes (2^31 = 2,147,483,648)

Change the variable type to Double, and you can transfer Terabytes of data...

----------


## BrendanDavis

> How much do you pay per month ?
> 
> I can choose to have higher speed from my provider if I pay more (of course), I think the highest is about the speeds you just mentioned, but is aproximatelly $60 (Canadian $) here. Now I'm paying $30 per month.


I pay $40 a month US. Don't know how much that is Canadian (even though I used to live there, lol). i think the exchange rate these days is .97 / dollar, or at least it was a week or two ago. so it's not THAT much more in canadian.

----------


## MrBeaker

Just wondering if you had any thoughts on how to transfer multiple files to the server  :Roll Eyes (Sarcastic):  

Thanks...

----------


## CVMichael

Well,  the server acceps more than 1 client, so send the files with more than one client...

Or, modify the client so that when it's done sending the current file, to load another file from a list, and send that one, and so on...

----------


## ppitta

Hi CVMichael, 

for couples of weeks i have been trying to write a client/server  application (1 server with multi-clients) which  can send and receive files (bidirectional).
without success, until today i land on your article on this great site. my problem was to handle more than one client while sending/receiving files, but with ur example code i think my life become a bit easier, i will ask for help just in case i'm having difficulties.  :Eek Boom:  

pp

----------


## ganeshmoorthy

The coding is really amazing....but Im trying to do the other way around...

Is there anyway I can use this code to send file from one server to multiple clients instead from multiple clients to one server...actually I have connected multiple printing machines to a server and all the production files I would like to transfer from a server thru network. Total Clients I have 5 and I will be transferring multiple files to each machine. The size of the files will be 25 MB to 50 MB and I got attracted by your code since it can transfer any size of file.

Any help?

----------


## CVMichael

If you transfer through local network, then there is a much better solution...

Right now, (if you reverse), when you send a file that is 50 MBytes * 5 times, that will be 250 MBytes sent over the network.

But... if you use UDP connection, you can *broadcast* the file to ALL computers at the same time, therefore if you send 50 MB to 5 clients, you are sending only 50 MBytes over the network ! You don't even have to specify the target computer to send to, as long as there is a program listening on the port on the client computer, they will pick up the file.

But since it's UDP, you probaly also have to add a CRC (or something like that) to make sure (on the client side) that you received the entire file.

Here is a related thread (To see how to broadcast):
VB6 - Winsock, Auto find server using UDP Broadcast (LAN ONLY)

I don't have time right now to make an example on how to do this (maybe when I get home)

----------


## ganeshmoorthy

If I use these forms in my two different projects (Client Form in one project and Server From in other project) Im getting Type Mismatch error at line FitTextInListView Me.lstConnections, 1, , K + 1 at the tmrStatus_Timer() at the ServerReceive Module

----------


## ganeshmoorthy

> If you transfer through local network, then there is a much better solution...
> 
> Right now, (if you reverse), when you send a file that is 50 MBytes * 5 times, that will be 250 MBytes sent over the network.


Yes, Im transferring thru the local network only (LAN)

I will be sending different set of files from the data process pc to each printing machine...that is for the Machine1, I will send the files for Job No. 1234, Machine2, I wll send the files for Job No. 1235 and so on...

I dont want to broadcast the files instead choosing some set of files to each machines based on the job number specified. And also I want to pass the information of the directory where it has to be stored.

Hope Im not confusing...If you want me to explain it more, I will do

----------


## CVMichael

Hi ganeshmoorthy,

I understand now... before I assumed you send the same file to all computers...

As I was saying before, right now I'm at work, and I don't have time, but hopefully I'll remember to make an example for you when I get home. I will probably add the example as a new thread in the CodeBank...

PS, how do you know what file to send to each computer appon connection ?

----------


## CVMichael

I started making the sample application, but it's gonna take a few days because it's a little complicated and I don't have a lot of time per day to do this. It's gonna be multithreaded & using API for file read/write (therefore files greater than 2GB).

But I need you to answer to my question so I know how to make the sample: How do you know what file to send to each client when it connects ?

Is the client requesting for a file ?
Or you just send file "X" when the IP matches with a list you already set in the server ?
Or some other criteria ?

----------


## ppitta

Hi ganeshmoorthy,

i have manage to play arround with this code, and come up with something like you want, coz i had the same problem before.

By adding receiving functionality to the client (from the server) and sending functionality to the server(from client),  can send and receive files. Note you can receive files from the server as long the file is in the server's folder.

i went further, by modifying this code to fit my requirements, now i can send and receive multiple files. in the attached modified version file there is server and part of client code which can send and receive multiple files.

----------


## ppitta

CVMichael

I'm trying to develop a client -server application,
where by users (on client side) need to attach(upload) and view(download) files from server machine. 

which is best way to use to store my files between 
1) using database to store files or
2) writing server application to receive and send files to the clients, like the one u provided.

----------


## ganeshmoorthy

Thank you very much for your interest in making a sample for me !!!


> But I need you to answer to my question so I know how to make the sample: How do you know what file to send to each client when it connects ?


The user will select multiple files from a flexgrid and click on the send button.

----------


## ganeshmoorthy

ppita, 
thank you very much for your work...let me check the code and get back to you..

----------


## CVMichael

> The user will select multiple files from a flexgrid and click on the send button.


So, where is the flexgrid ? on the server or on the client ?

In other words, the user on the server decides what to send to client ? Or the client decides what he/she wants to receive from the server ?

PS. I need a few more days to finish it, until now I had bad luck (yesterday there was no power in the whole building, so I could not even start the computer)

----------


## ganeshmoorthy

> In other words, the user on the server decides what to send to client ? Or the client decides what he/she wants to receive from the server ?


The user on the server decides what to send to client...



> PS. I need a few more days to finish it, until now I had bad luck (yesterday there was no power in the whole building, so I could not even start the computer)


My bad....

----------


## Touchdrop

Hi,

In continuation to sending file thru Winsock I have a question.

I have a Server receiving data from a ADConverter[with TCP/IP Interface] thru winsock W1.

Now I have 2 other Displays and 6 PCs where the data received is to be displayed. The DIsplay Units are having TCP/IP interface.

In my server program I have incorporated two other winsock W2, W3.

Indivisually when I am sending data to W2 or W3 by senddata each of them are displaying data on dataarrival from W1. 

Problem is if I connect W3 after W2, the display on Display-W2 stops but Display-W3 working and vice versa.

Any solution.... URGENTLY NEEDED.

Thax & Regards.
SG

----------


## leon100243

why....?
Please help me~

----------


## volkore

how can i get the file send by the client?where can i find it?

i need some help..plss..

----------


## CVMichael

Hi volkore, welcome to the forums  :wave: 

The file is in the server's application path (wherever the server application is).

If you are running from the IDE, also look here: C:\Program Files\Microsoft Visual Studio\VB98

----------


## ohailo

Wow..your a pro and a insane too....

----------


## whatsup

I have some newb question:

please correct me if i'm wrong.

from the listen code (server) i saw that it listen only to port 8866,
no IP nor host name, need for the connection.

1. so my question is that enough to recieve connection ?
i mean, every computer on the net that send data on this port,
could connect to this server, (in case the server doesn't require any other ID) ?

----------


## CVMichael

A server always listens on the localhost, so that's why you don't have to give an IP, just the port is enough.

The client needs to know what computer to connect to, so it needs an IP, once it knows the computer, then you give the port.

As long as your router (on the server computer) routes the port properly, and the firewall allows the port to be opened, and also allows incomming connections on that port, then the client should be able to connect. And of course the firewall on the client side has to allow outside connections also...

----------


## whatsup

oh, thank you very much, i see now, that it's the client who need to know the IP,
i'll look for that in the code, thank you.

now i have a little problem.

as maybe this ocx might not be installed by default on every pc,
and i don't want to depend on it,

does someone know how to do this task with API ?

i have a full demo code using API only,
to download a file from a site.
but i'd like to know, how to download from another computer.

maybe all i need, is to supply the IP address (converted to num maybe), instead of the site address ?

second question, 
is there a way to build an exe file included the ocx ?
it could be much easier instead of using API.

----------


## whatsup

I found a solution for the ocx issue,
there is a program called makesfx, that can make self extracting file and also execute some file after the self extract.

so i can pack all the components i want in one file, and include a setup file in that archive, that will be automatically executed on extract.

----------


## CVMichael

Package & Deployment Wizard comes with VB... why can't you just make a setup for the application ?

----------


## whatsup

because ...
i'd like to do it myself, not an issue.

i have a question
i tried to send/recieve between 2 virtual machines.
they both on the same IP.
i gave to the sender the internet IP (instead of hostname)
but it didn't work.
(on the same machine it works well.)

i hope i could try this with someone on other computer with different IP
maybe it will work  :Smilie: 

anyway thanks for the code.

----------


## jlt212000

i have utilized your software for my passport scanning that saves an image to the server. But my problem is.. the image size saved on the server is 3 to 4 times larger than the image size saved on the client. 
client image = 16 Kb
server image = 54 Kb

im trying to minimize as much as possible the image size in the server because there will be a lot of images that will be stored there..

Need help.. thanx.

----------


## deepz

i opened 4556 port and successfully transfered (file size 2 mb) but where does it saving  :EEK!: 

and i have tried with localhost too,i cant find that i transfered file  :Sick: 

hope some one will help me
thanks in advanced

//deepz  :Duck:

----------


## CVMichael

Did you check the App.Path ?

Or did you look in the code to see where it's saving ?

----------


## deepz

> Did you check the App.Path ?
> 
> Or did you look in the code to see where it's saving ?


you mean this one ???



```
 Clients(Index).FileNum = FreeFile
        Open App.Path & "\" & Clients(Index).FileName For Binary Access Write Lock Write As Clients(Index).FileNum
```

if i want to send C:\WINDOWS\system32

code is


```
Open App.Path & "C:\WINDOWS\system32" & Clients(Index).FileName
```

am i correct?

----------


## CVMichael

Why would you transfer files into the systems folder ?

Probably you have to add "\", like


```
Open App.Path & "C:\WINDOWS\system32\" & Clients(Index).FileName
```

----------


## deepz

> Why would you transfer files into the systems folder ?
> 
> Probably you have to add "\", like
> 
> 
> ```
> Open App.Path & "C:\WINDOWS\system32\" & Clients(Index).FileName
> ```


system folder just for example  :Big Grin: 

i got error



plz can attach ur working project file with my path  :Ehh:

----------


## CVMichael

Does "new folder" exist ?

[edit]
Wait a minute... why you have App.Path & "C:\Windows"...

That will give you path like "C:\somethingC:\Windows"... does that look right to you ?

Remove the App.Path, and make sure "new folder" exists.

Why could'nt you just put a break point at that line, and check the path by yourself ?

----------


## deepz

> Does "new folder" exist ?
> 
> [edit]
> Wait a minute... any you have App.Path & "C:\Windows"...
> 
> That will give you path like "C:\somethingC:\Windows"... does that look right to you ?
> 
> Remove the App.Path, and make sure "new folder" exists.
> 
> Why could'nt you just put a break point at that line, and check the path by yourself ?


put any path  :Wink:  im not good at vb  :Ehh:  plz attach ur project file

thanks

----------


## starlight

Hi all,

how can i send the files from PC using Window CE to PC using Window XP and by using LAN connectivity? let PC window CE as slave and PC window XP as master, then how can I ping the ethernet from window XP to make sure the validity of both connection then send a file over PC? 

Thanks.

----------


## J.J.Johnstone

How might you go about informing the Client side that the Server is not active/listening?

----------


## whatsup

is there a way to increase the packet size above 4KB, something like 32/64KB ?
i tried this, and it doesn't work. it seems that the limit is 4K.

----------


## CVMichael

The TCP protocol divides the data into 4K packets, so even if you send 100K in one "SendData", it will divide the data in 25, 4K packets. There is absolutely nothing you can do about it.

----------


## whatsup

thank you, i guess my problem was that i didn't wait for the finished transfer event,
i discovered this when i sent two packets one after one,
then i also read what you said about this, you definitely right,
things won't work if you don't wait for this event, unless you send tiny packets.

i also don't use this event to do the transfer (as you said),
in this event i set a flag
and i wait for this flag with do events like this


```
Private Sub Send(ByVal TheData$)
    blnCandSend = True
    sck.Send TheData$
    While blnCandSend
        Do Events
    Wend
End Sub

Private Sub sck_SendComplete()
    blnCantSend = False
End Sub

Private Sub sck_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
    blnCantSend = False
End Sub

Private Sub sck_Close()
    blnCantSend = False
End Sub
```

for me it's better this way, than using a timer.

----------


## whatsup

CV, i found strange thing in vb WinSock
the client send the file header
in three seperated packets
one after one.
but on the server side, they all got as one packet.

i can only guess that this is because WinSock slowly

in my WSocket, these three packets, get as three seperated packets,
there for i changed this to one packet.

here is the attachment with my new WSocket, in your demo project.

the client which doesn't use any ocx, can work on Windows7.

----------


## ِAdmiral

that is not working with RHOST
i test it

----------


## CVMichael

I have no clue what RHOSt is...

----------


## ufo973

@CVMicheal
I like your code and it was what i was looking for, but i have one question.
How can i send more then one file at the same time from a client (not multiple clients)?
I hope you answer this. Thank You

----------


## CVMichael

It's been a while since I saw this project, but from what I remember if you change the winsock control to a control array, and the rest of the code to create a new instance, and start transfering on that instance.

----------


## ufo973

Can you create a user control out of it? if it is easy and you have time.

----------


## CVMichael

Sorry, I don't do programming in VB6 for a few years, I switched to .NET. And my life has changed dramatically, as you can see I'm not active on the forums anymore. I just answer 5 min questions once in a while.

----------


## ufo973

@CVMichael
I have successfully implemented your code in my 2 projects, 
1 to send live webcam captures from server to client, 
And my 2nd project a remote file downloader/uploader.
 but i don't know what packet sizes should i set for these 2 projects.
Can you give me some idea please? I mean what should be packet size for live webcam captures transfer which requires a fast transmission, and 2nd remote file uploader/downloader?
Thank you very much.

----------


## CVMichael

4Kbytes should be the norm. Anything smaller it will send too often therefore slowing down the connection, anything bigger will be broken up in smaller packets anyways.

----------


## ufo973

So it means increasing the packet size won't increase the upload/download speed?

I have one more problem please, 
you implemented stuff like speed, time remaining and bytes sent for sender side, but not in the receiver side which i can't figure out.
Can you please help me with this. Thanks Again

Here is the code from the sender side


```
Private Sub tmrCalcSpeed_Timer()
    Static PrevSent As Long
    Dim BSentPerSec As Long, DataSent As Long, DataLen As Long
    Dim SecondsLeft As Single
    
    If iFileNum > 0 Then
        DataSent = Loc(iFileNum)
        DataLen = LOF(iFileNum)
        
        BSentPerSec = DataSent - PrevSent
        PrevSent = DataSent
        
        SecondsLeft = (CSng(DataLen) - CSng(DataSent)) / CSng(BSentPerSec)
    Else
        PrevSent = 0
    End If
    
    lblSendSpeed.Caption = Format(DataSent / 1024#, "###,###,##0.00") & " KBytes Sent, " & _
        Format(CDbl(BSentPerSec) / 1024#, "#0.00") & " Kb/Sec, " & _
        "Time left: " & Format(SecondsLeft \ 3600, "00") & ":" & Format(SecondsLeft \ 60, "00") & ":" & Format(SecondsLeft Mod 60, "00")
End Sub
```

How i can change it to work with the receiver side?

----------


## kholous

If many person send a similar file we see Error word in the program . 
How can correct this action?
Thanks.

----------


## ramu123

hai all  can anybody suggest me to "how to get the data in packet by packet format instead of whole stream "  plz  i hav to submit project soon

----------


## ramu123

hai sir  this ramu    i hav to read the data at winsock reciever BYTE by BYTE  instead of STREAM of data(packet by packet)   for that i m using  "binary read write mode"  but it is not working after sometime  it showing the error "DIVISION BY ZERO" problem       please help me sir..............

----------


## jam311

> why....?
> Please help me~


I am trying to achieve a similar application.I am not able to find the codes related to this.Will you be able to help me.Thank you

----------


## afdoal

thanks for your project  :Smilie: 

but, i have a question, can i know how much data has been passed in winsock? (in MB or kb)?? 
thanks b4

----------

