Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Run custom PHP after file upload
Flabaliki Offline
Junior Member
**
Posts: 16
Joined: Jul 2010
Post: #1
Run custom PHP after file upload
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!

http://youtube.com/Flabaliki
(This post was last modified: 09-01-2012 08:53 PM by Flabaliki.)
08-31-2012 10:08 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Run custom PHP after file upload
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.


My Blog
09-01-2012 05:13 PM
Find all posts by this user Quote this message in a reply
Flabaliki Offline
Junior Member
**
Posts: 16
Joined: Jul 2010
Post: #3
RE: Run custom PHP after file upload
Ok, I'll give it a shot, thanks for the info Smile

http://youtube.com/Flabaliki
09-01-2012 08:53 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Flabaliki Offline
Junior Member
**
Posts: 16
Joined: Jul 2010
Post: #4
RE: Run custom PHP after file upload
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!

http://youtube.com/Flabaliki
09-02-2012 12:24 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: