MyBB Hacks

Full Version: Run custom PHP after file upload
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, this may seem a bit confusing at first, but I'll try to explain it as best as I can.

I'll be using Xthreads to manage file uploads. One of the file types that I'll be allowing (.Sims3Pack) has a bunch of stuff in it that essentially doesn't need to be there. I am able to modify the file via PHP successfully and have done so in the past.

My question is this; do you have any idea how I could run this PHP code after the file has been uploaded so that I can update this file and remove the unnecessary content?

In short, I want to modify a file after it has been uploaded and save the new file over the uploaded one.

Thanks for any help!
Interesting.
I guess you could try this: find in inc/xthreads/xt_upload.php

PHP Code:
	if($update_attachment) {
		unset($attacharray['downloads'], $attacharray['uploadtime']);

Modify the $attacharray before that code.  Don't forget this code affects every xtattachment.

Ok, I'll give it a shot, thanks for the info Smile
Just reporting back;
I was able to put my own code in there to deal with the files quite well Smile. I just made sure to verify the file type before I did anything. Thanks for such an awesome plugin!
Reference URL's