CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2001
    Location
    israel
    Posts
    99

    Server and client for transfer files

    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.


  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: Server and client for transfer files

    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!


  3. #3

    Re: Server and client for transfer files

    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/im...ertaplanet.gif'>
    </center>

  4. #4
    Join Date
    Aug 2001
    Posts
    26

    Re: Server and client for transfer files

    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




  5. #5
    Join Date
    May 2001
    Location
    israel
    Posts
    99

    Re: Server and client for transfer files

    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


  6. #6
    Join Date
    May 2001
    Location
    israel
    Posts
    99

    Re: Server and client for transfer files

    hi,

    i need it to be both. lan and internet.

    ohad.


  7. #7
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Server and client for transfer files

    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
    [email protected]

    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
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  8. #8

    Re: Server and client for transfer files

    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/im...ertaplanet.gif'>
    </center>

  9. #9
    Join Date
    Aug 2001
    Posts
    26

    Re: Server and client for transfer files

    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




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured