XF 2.3 Example of file upload

stromb0li

Well-known member
Really broad ask here, but is there an example or reference I can use to see how to implement proper handling of file uploads as an add-on?

I understand in the template, I can use <xf:upload>, and to get the uploaded file I can use $uploaded_file = $this->request->getFile('upload', false, false);, however I'm curious how this should be handled via my controller? Should it be part of generic XF attachments, should my add-on solely handle it; how should I handle save/reference to data folder, etc.
 
Last edited:
I don't think so but you should check the code to see how it is handled for resource icons for example if it's just simple uploads.

Otherwise perhaps you can also consider using the attachments technology, it all depends of your needs.
 
Back
Top Bottom