2

How can I add an the Joomla built-in uploader to my component's admin back-end such that the file itself is saved in a folder somewhere in the server and the filename or url is saved in the DB? The docs for JHMLBehavior/uploader under http://docs.joomla.org/API16:JHtmlBehavior/uploader are useless, and I've tried Googling for a comprehensive guide on how to do this but couldn't find any.

Please help.

Regards, Simon

Simon Kagwi
  • 1,636
  • 2
  • 19
  • 25

2 Answers2

4

You can check out administrator/components/com_media to see how they use JHTMLBehaviour::uploader(...). The problem is that the fancy script that the uploader is based on is version 1.0 - and it doesn't work....

I would recommend checking this tutorial instead: http://docs.joomla.org/Creating_a_file_uploader_in_your_component

Daniel Dimitrov
  • 1,848
  • 21
  • 35
1

You're aware that you're looking at the 1.6 version of the code, not 1.5? 1.5 is the current release - 1.6 probably hasn't got the full set of documentation.

Jeepstone
  • 2,591
  • 5
  • 22
  • 38
  • Thanks for pointing that out. However, even the documentation for 1.5 (http://docs.joomla.org/API15:JHTMLBehavior/uploader) has the same stuff: syntax and source code with no example(s) or solid ducumentation on how to actually use the uploader. Doesn't help much. An example would be most helpful. – Simon Kagwi Aug 23 '10 at 14:06
  • OK. Here's a thread I created on Joomla.org http://forum.joomla.org/viewtopic.php?f=476&t=280655 Towards the bottom, there is a link to a post on Google Groups http://groups.google.com/group/joomla-devel/browse_thread/thread/dc094ddca7eec259 Essentially, my fix involved using the Media Manager popup to select the image and then popping it into a database field. You can also use Media Manager to upload the image. – Jeepstone Aug 24 '10 at 08:12