Results 1 to 6 of 6

Thread: How to make file send in chat??

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Location
    Croatia/Čepin
    Posts
    13

    How to make file send in chat??

    Hi!
    I was make Multi-Chat program (server/client) you can download it here .
    Now I wonna make file send but I don't know how can anyone help me?

    sorry for bed english!

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: How to make file send in chat??

    Have you included DCC chat in your program? If so, send and receive the file using DCC.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Location
    Croatia/Čepin
    Posts
    13

    Re: How to make file send in chat??

    No I did't include dcc chat. How I can include dcc chat?? you can download source of chat here

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: How to make file send in chat??

    You have to develop some protocol for file sending - dcc is just one such protocol. You could change each byte to 2 bytes, the hex equivalent of the character, which is how it used to be done on Usenet, or you could send them as is - which you do depends on how you develop the protocol. IOW, 'A', being 41 hex, would be sent as '41', etc. You'd also want to send a header with the total file size and file name, date and any other info you're sending.

    It could be as simple as just a "the following is a file - don't display it" header, followed by a filename, date, size header, followed by 1k (or 2k or 4k) chunks of file, until the entire file has been sent.

    The receiver, on receiving the first 2 headers, would pop up a message saying that user X wants to send file Y and asking the user if he wants to receive it. If he says yes, the program sends a "go ahead" header, and the file gets sent. If he says no, a "cancel the transfer" header gets sent, the sender is advised that the receiver doesn't want the file and the transfer is aborted.

    The headers could be anything - 01 = this is a file transfer, 02 = go ahead, 03 = cancel, etc.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  5. #5
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: How to make file send in chat??

    I've made tons of chat/file transfer programs but that was awhile ago and I don't have any code lying around. There is some code in the code bank though.

    But Al42 described the basic process pretty well.

    Edit: I found some code I put on PSC awhile ago but that was back when I wasn't as experienced with Winsock, but it still works.

    Here's a simple 2-way chat with file transfers:
    http://www.pscode.com/vb/scripts/Sho...46633&lngWId=1

    And a Remote File Manager that has a few bugs but the file transfers should still work.
    http://www.pscode.com/vb/scripts/Sho...50253&lngWId=1

    It comes with a file sender/receiver control that I made and you can either use in your program or learn from it and make your own.

    I've since learned better ways to do it so you may want to take what you can from it and change the rest.
    Last edited by DigiRev; Jan 5th, 2007 at 01:12 PM.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Location
    Croatia/Čepin
    Posts
    13

    Re: How to make file send in chat??

    ok thx I will try now to make file transfer.

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