Send jpg file using the winsock TCP/IP

halo all,...
i got serious problem with sending file across the network using the TCP.
The files are actually jpg or Bmp...
i've tried to source from the internet,...but a lot of them are send text / string wihich is not capable to send the jpg /bmp...
i would like to know how to receive and send  a binary files / jpg / bmp file thru TCP
pls show some important codes on the Client and the server program..thanks

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HI !
I have found this source (sorry it is in french.. but it's work very fine !)
Look here:
ksboyzAuthor Commented:
eh,...i have try out the program,'s still have some distortions on bmp file,...and totally failed on the jpg file.....the jpg file became corrupted.....

any other way??? i have found out some vb programs which able to send / receive binary file without corruption...
but too bad they nvr provide the source codes.... :(
help me,... : (

Have you tried this example already?
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

ksboyzAuthor Commented:
tried already,....still having problem of sending the jpg file....

from ksboy
It really depends on how your server/client is set up.


Dim intFile as Integer
intFile = FreeFile()

Dim bArray() as Byte
Open "file.jpg" For Binary as intFile
ReDim bArray(LOF(intFile))
Get intFile, 1, bArray
Close intFile

wskServer.SendData bArray()

then on the client side DataArrival event...

(again this depends on your setup)

Dim bArray() as Byte
wskClient.GetData bArray, vbByte + vbArray

Dim intFile as Integer
intFile = FreeFile

Open "file.jpg" For Binary as intFile
Put intFile, 1, bArray
Close intFile

ksboyz, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
PAQed, with points refunded (100)

EE Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.