Click to See Complete Forum and Search --> : Server and client for transfer files
ohadbp
August 29th, 2001, 10:49 AM
hi guys,
i m building a server and a client for transfer files between them.
1) what is the best way to do it? using ftp or
tcp/it?
2) how do i set my server to be ftp server?
i am a begginer in all this network programming so if you can give me an example code i will appriciate.
thanks,
ohad.
DSJ
August 29th, 2001, 10:56 AM
Set a reference to the Winsock control and play with that some. Looking at it's properties/methods in the object browser will give you some ideas. Don't have an example... sorry!
berta
August 29th, 2001, 06:42 PM
1)FTP is a protocol based on TCP/IP. U can use Inet control or Mabry FTP control. ...using winsock control to control an FTP connection... It's too hard!
2)If U have a OS windows U can find the installaztion of a FTP service in Option pack 4.
but is your server in LAN or you have a Internet Connection with server?
hi,brt
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/images/bertaplanet.gif'>
</center>
bhanuprakash
August 29th, 2001, 11:16 PM
you can use the winstock control to transfer the file to the server and its better you use tcp/ip protocol instead of ftp.
you can use winstock properties like senddata
you have to write the code in ws_dataarrival ,ws_connect procedures
ohadbp
August 30th, 2001, 01:06 AM
hi,
i tried to use winsock control but it doesnt transfer the file himself.
when i write: winsock1.SendData nameofthefile.
i recieve the name of the file in the server and not the file himself.
any idea how i can send the file himself?
p.s. i dont want to read the file until eof and send line by line to the server.
thanks,
ohad
ohadbp
August 30th, 2001, 01:09 AM
hi,
i need it to be both. lan and internet.
ohad.
Cakkie
August 30th, 2001, 01:20 AM
If you don't want to read the file, and then send it line by line, you will have to use another control than the winsock.
Winsock basically means "we make the connection for you, what you do with the connection is up to you".
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
berta
August 30th, 2001, 01:44 AM
U must add Microsoft INternet TRansfer control 6.0. ThenU must add an iNet control and set protocol=icFTP.
Inet1.UserName = "myuser"
Inet1.Password = "mypwd"
Debug.print Inet1.OpenURL("myserverFTP/mydocument")
hi,brt
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/images/bertaplanet.gif'>
</center>
bhanuprakash
August 30th, 2001, 01:45 AM
u can use internet transfer control u have an ocx called msinet.ocx.if u use this ocx u get that control and then u specify the protocol as iftp,
u have to specify the proxy,the host the remote server e.t.c after you do this you can put in this particular code
Private Sub cmdSEND_Click()
Inet1.Execute txtURL.Text, _
"SEND C:\MyDocuments\Send.txt SentDocs\Sent.txt"
End Sub
this will transfer the file.which this control you can even get the file from the server.for more info you can go to hlp files.
Hope this will solve ur problem
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.