PDA

View Full Version : Handle attachmentdata in vB 3.6 (for use with torrents)?


TMM-TT
10-13-2006, 03:51 PM
I'm writing a plugin that should act as some kind of torrent-tracker. The plan is to make it easy to just upload a torrent by using regular attachments, and after this, a "tracker" should automatically handle the attached file as a torrent. The way I'm doing this is to read the filedata when a file is uploaded, just to see if the file really is a torrent. I also need to read the data to get the hash out of the file.

The problem is that I can't find out exactly where to read the filedata received from the uploader. Currently I use newattachment_attach, just because of the hash/attachmentid but I can't find any trace of the data and I really looked everywhere for it. The code I'm writing is based on Torrentbits (http://sourceforge.net/projects/tbsource)old tracker to get what I want out from it, but the files there are handles differently...

Can someone help? Where do I find the attachmentdata? I'm frustrated! :confused:

TMM-TT
10-15-2006, 11:24 AM
Suggestion:

Read attachments from newpost_complete. :cool:


Another suggestion: Add virusscanner, the same way? :P

toolmanwill
11-20-2006, 01:58 PM
use attachdata postsave hook or it can also be done in class_upload.php