Hello and thanks in advance for the help;)
I'm using the link plugin, for PHP Uploader, and in /php/class.uploader.php I'm trying to change the path where I upload the files:
private function initialize($field, $options){
if(is_array($field) && in_array($field, $_FILES)){
$this->field = $field;
$this->field['Field_Name'] = array_search($field, $_FILES);
$this->field['Field_Type'] = 'input';
if(!is_array($this->field['name'])){
$this->field = array_merge($this->field, array("name" => array($this->field['name']), "tmp_name"=>array($this->field['tmp_name']), "type"=>array($this->field['type']), "error"=>array($this->field['error']), "size"=>array($this->field['size'])));
}
foreach($this->field['name'] as $key=>$value){ if(empty($value)){ unset($this->field['name'][$key]); unset($this->field['type'][$key]); unset($this->field['tmp_name'][$key]); unset($this->field['error'][$key]); unset($this->field['size'][$key]); } }
$this->field['length'] = count($this->field['name']);
}elseif(is_string($field) && $this->isURL($field)){
$this->field = array("name" => array($field), "size"=>array(), "type"=>array(), "error"=>array());
$this->field['Field_Type'] = 'link';
$this->field['length'] = 1;
}else{
return false;
}
if($options != null){
$this->setOptions($options);
}
$varuser='test';
//$varuser=$_SESSION['username'];
$this->options['uploadDir']="../../../uploads/".$varuser."/";
return $this->prepareFiles();
}
As you can see, at the end of the function I am declaring the "option" UploadDir as the concatenation of "../../../uploads/" + $ varuser + "/", using the code as it is (ie with $ varuser = 'test') everything works correctly.
But, my problem starts when I try to assign the session variable in which I save the connected user, if I use the debugger mode in Chrome I relate the error to the following reference: custom.js: 91 (/ examples / dragdrop / js)
Please, does anyone know what's going on? Why can not I assign the session variable but a variable defined "by hand"?
Thank you very much! Greetings.