ksboyz
asked on
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
from
ksboy
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
from
ksboy
ASKER
hi,
eh,...i have try out the program,...it'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,... : (
from
ksboy
eh,...i have try out the program,...it'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,... : (
from
ksboy
ASKER
tried already,....still having problem of sending the jpg file....
from ksboy
from ksboy
It really depends on how your server/client is set up.
Basically...
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
Basically...
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
Moderator, my recommended disposition is:
Refund points and save as a 0-pt PAQ.
DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have found this source (sorry it is in french.. but it's work very fine !)
Look here: http://www.vbfrance.com/article.aspx?ID=4056
++