Custom Image Upload...


New member
I am trying to do a custom "Post Thread".


Now now.... i am editing forum.php and create a new function for this.
Lets say my input file called "FILE", which is suppose to be only image can be uploaded.

How do I use this object???
For the other input text, I know we have to use
$this->_input->filterSingle('product_name', XenForo_Input::STRING)

How about the uploaded file?? How do I call it?? I need to save the image in separate folder.

Any help will be appreciated. Thanks


New member
For file uploading:
$image = XenForo_Upload::getUploadedFile('name_attr');
yeap, i used it....
I have added enctype="multipart/form-data" on my form as well.
and add that declaration --> $image = XenForo_Upload::getUploadedFile('name_attr');

how do i use this variable $image??? how to get the filename??

say i want to upload to a specific directory, how???

thx in a million....


New member
i tried that but it wont work....
it gives me this error
Call to a member function getFileName() on a non-object in /var/www/xx/library/XenForo/ControllerPublic/Forum.php on line 644

getFileName is under diff class.... XenForo_Upload.

You can refer to my code in this thread.
Last edited: