PHP auto detect upload url path -
i work in responsivefilemanager , in config file have 2 line:
$upload_dir = '/user/uploads/files/'; // path base_url base of upload folder (with start , final /) $current_path = '../../../../uploads/files/'; // relative path filemanager folder upload folder (with final /) this wroked in xammp system (with sub folder. /user/ sub folder). if move in real server need edit 2 line , remove sub folder , 1 ../ 2 line.
now, need auto detect url path. mean : if install in sub folder or root folder 2 line worked in script without manual editing.
how can create this?
there no particular way autodetect directory upload to. easiest solve checking if directory exists , use other directory if not found.
however, i'd suggest having same relative structure on both systems best solution. same relative structure should work across servers , systems without having change anything.
Comments
Post a Comment