izikperz Posted February 3, 2017 Share Posted February 3, 2017 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 Quote Link to comment Share on other sites More sharing options...
kicken Posted February 3, 2017 Share Posted February 3, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.