Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File upload Problems
#23
Spacecop, hang in there Cool I might have a solution for you... please do not use my suggestion yet...

Matteo... coding question for you:

this function causes the problem when the safe_mod or open_basedir is in effect:

function called by lines:
PHP Code:
<?php 
// copy file
if (!makeDir($settings->_contentDir . $dir)) return false;

so the function explodes a path into this:

PHP Code:
<?php 
Array (
[
0] =>
[
1] => users
[2] => schule
[3] => www
[4] => 1
[5] => download
[6] => 1048576
[7] => 1
[8] => 4
[9] => )

and then you check if each element is a folder and if not, you recreate it with

PHP Code:
<?php 
if( !is_dir( $mkfolder ) ){
$res=@mkdir( "$mkfolder" , 0777);
if (!
$res) return false;
}

so in this case, the restriction in effect, does not allow folder /users to be even checked... then my question is, why can't we just do the checking for any folder ONLY inside the $_contentDir? why checking the full path?
Reply


Messages In This Thread
File upload Problems - by spacecop - 08-09-2010, 03:24 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)