forumnz Posted September 21, 2007 Share Posted September 21, 2007 Hey, I want to upload images via the Joomla media manager. Prob is that it uploads with CHMOD 0600 and can't display properly with a mod I have. I want to be able to upload with 0644. I have found the possible source but I dont know what to do with it. I believe I should add , 0644 somewhere. Can someone please help? Sam. function upload() { if (isset($_FILES['upload']) && is_array($_FILES['upload']) && isset($_POST['dirPath'])) { $dirPathPost = $_POST['dirPath']; $file = $_FILES['upload']; if (strlen($dirPathPost) > 0) { if (substr($dirPathPost,0,1) == '/') { $IMG_ROOT .= $dirPathPost; } else { $IMG_ROOT = $dirPathPost; } } if (strrpos( $IMG_ROOT, '/' ) != strlen( $IMG_ROOT )-1) { $IMG_ROOT .= '/'; } do_upload( $file, COM_MEDIA_BASE . $dirPathPost . '/'); } } Quote Link to comment https://forums.phpfreaks.com/topic/70111-small-joomla-prob/ Share on other sites More sharing options...
forumnz Posted September 21, 2007 Author Share Posted September 21, 2007 Help please? Quote Link to comment https://forums.phpfreaks.com/topic/70111-small-joomla-prob/#findComment-352207 Share on other sites More sharing options...
forumnz Posted September 21, 2007 Author Share Posted September 21, 2007 Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/70111-small-joomla-prob/#findComment-352496 Share on other sites More sharing options...
rarebit Posted September 21, 2007 Share Posted September 21, 2007 http://sg.php.net/manual/en/function.chmod.php Quote Link to comment https://forums.phpfreaks.com/topic/70111-small-joomla-prob/#findComment-352502 Share on other sites More sharing options...
forumnz Posted September 21, 2007 Author Share Posted September 21, 2007 Thanks, why won't the following work? function upload() { if (isset($_FILES['upload']) && is_array($_FILES['upload']) && isset($_POST['dirPath'])) { $dirPathPost = $_POST['dirPath']; $file = $_FILES['upload']; if (strlen($dirPathPost) > 0) { if (substr($dirPathPost,0,1) == '/') { $IMG_ROOT .= $dirPathPost; } else { $IMG_ROOT = $dirPathPost; } } if (strrpos( $IMG_ROOT, '/' ) != strlen( $IMG_ROOT )-1) { $IMG_ROOT .= '/'; } do_upload( $file, COM_MEDIA_BASE . $dirPathPost . '/'); chmod(COM_MEDIA_BASE . $dirPathPost . '/', 0644); } } Note the extra: chmod(COM_MEDIA_BASE . $dirPathPost . '/', 0644); Quote Link to comment https://forums.phpfreaks.com/topic/70111-small-joomla-prob/#findComment-352559 Share on other sites More sharing options...
rarebit Posted September 21, 2007 Share Posted September 21, 2007 I think this actually points to your new File! COM_MEDIA_BASE.$dirPathPost.'/'.$file Quote Link to comment https://forums.phpfreaks.com/topic/70111-small-joomla-prob/#findComment-352565 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.