• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Custom Image Upload...

#1
I am trying to do a custom "Post Thread".

upload_2014-1-22_16-47-28.png

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
 
#3
For file uploading:
PHP:
$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....
 
#5
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: