PDA

View Full Version : Best place in code to analyze and accept/deny attachments?


FractalizeR
11-15-2007, 04:50 PM
Hello.

I am working on custom add-on, that makes custom analysis of attachments, that users upload on forum (for example, preventing password protected archives to be uploaded on forum).

So, I need a place in code, where I can put my verification routine call. At this place in code uploaded attachments both by $_FILES and by URLs should already present in filesystem in order to be analyzed. I cannot analyze them in memory.

Could someone tell me, what is the best place to put my code in?

Analogpoint
11-15-2007, 08:53 PM
I'd do it right after the data is uploaded. maybe attachdata_presave ?

FractalizeR
11-15-2007, 09:22 PM
I thought about it. But I cannot get filepaths from there. And filedata variable at this step on some reason contains the whole uploaded file contents there if even I store attachments at filesystem.

$this->fetch_field('filename') returns only original filename of the attachment, not it's name in filesystem