$root_img, 'destDir'=>$root_img, 'upload_url'=>$root_img, 'max_size'=>array( 'jpeg'=>'20111110', 'jpg'=>'2011110', 'gif'=>'2011110', 'png'=>'2011110', 'bmp'=>'2011110', 'txt'=>'500' ), 'file_support'=>array('jpeg', 'jpg', 'png', 'gif','bmp' ), 'thumbnail_dir'=>$root_img , 'thumbnail_url'=>$root_img , 'thumbnail_dimension'=>array("max_width"=>940,"max_height"=>200) ); // $options['callback'] = 'add_userEntry'; // $options['loadcallback'] = 'getalldetails'; $options['loadcallback'] = 'get_list_images'; $options['root'] = '.'; $userid = 5; $action = $_REQUEST['action']; $Filehandler = new AjaxImgupload($options); $Filehandler->responder($action); function get_list_images($obj){ $path_img=$obj->options['destDir'] ; $path= $path_img; if (is_dir($path)) { $fh = opendir($path); $details = array(); $details['files'] = array(); while ($file = readdir($fh)){ $pathfile = $path . $file; if ($file != '.' and $file != '..' and $file != '.svn' and !is_dir($pathfile)){ $details['files'][] = array( "name"=>$file, "upload_name"=>$file, 'thumbimgurl'=>$pathfile, 'action'=>'loaded', 'imgUrl'=>$path_img.$file, ); } } closedir($fh); } else{ echo realpath("."); echo "Erreur dir: " . $path ; } return $details; } ?>