File Upload Path - Joomla! Forum - community, help and support
hello,
i'm building component requires administrator upload files @ backend (administration panel), , user can view file on frontend.
in order upload, i've used this:
fresh joomla documentation. however, there 2 problems this:
1) jpath_component absolute path file @ server. upload goes smoothly, when wish display file, need relative path (to put in <img src=""> or whatever). how relative path?
2) jpath_component in administration panel points component administrator folder. think more correct put uploaded files in frontend component folder. there constant or somesuch gives me path frontend component folder?
thanks in advance.
i'm building component requires administrator upload files @ backend (administration panel), , user can view file on frontend.
in order upload, i've used this:
code: select all
$dest = jpath_component . ds . "uploads" . ds . $name;
jfile::upload($src, $dest);
fresh joomla documentation. however, there 2 problems this:
1) jpath_component absolute path file @ server. upload goes smoothly, when wish display file, need relative path (to put in <img src=""> or whatever). how relative path?
2) jpath_component in administration panel points component administrator folder. think more correct put uploaded files in frontend component folder. there constant or somesuch gives me path frontend component folder?
thanks in advance.
why don't use images folder?
from there on have com_media_base, , com_media_baseurl in component.
olaf
code: select all
$params =& jcomponenthelper::getparams('com_media');
// set path definitions
$path = "image_path";
define('com_media_base', jpath_root.ds.$params->get($path, 'images/stories'));
define('com_media_baseurl', juri::root().$params->get($path, 'images/stories'));
from there on have com_media_base, , com_media_baseurl in component.
olaf
Comments
Post a Comment