Jump to content

IRC file downloading


izikperz

Recommended Posts

I am trying to create a simple web page that will display a text file's content but the text file needs to be downloaded via IRC (internet relay chat). Currently, I have a PHP script that connects to IRC via fsockopen(), joins a channel, types a string into the channel which in turn prompts me to accept a direct client to client download (the text file).

 

I don't know how to accept this download and then download it so that I can pass the contents back to my javascript from my PHP script. Can anyone provide any type of guidance or advice?

 

Thanks

Link to comment
Share on other sites

First, you'll have to learn enough of the IRC client protocol to connect to the server and make your DCC request. You say you have this working already, is so that's a good start. If you haven't already you should look through the RFC even if what you have works, just to make sure you're not missing anything important or doing anything incorrectly.

 

Next you'll need to learn the CTCP Protocol and read about the DCC Extension to it to request the file. You'll have to open a listening socket on which you can receive the file then transmit it's details to the sender.

 

Once you have all that working you'll just have to figure out the best way to tie it all together in the way you need. If the files you're transferring are small then you can probably do the whole transaction in one script. If the larger you may need to separate out the file transfer process so the browser doesn't hang up waiting for the server.

 

I implemented DCC Transfers in an IRC bot I wrote many years ago. Most of the file transfer code has been lost over time but some of the basics is still there. You can look at it to get an idea of the process but don't try and use it as-is, it's terribly outdated and incomplete.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.