pdf viewer not working

Hi, am new to webix, and have been trying to make a pdf reader, here is my code

javascript
tree script

       var docTree ={
       view:"tree",
       editable:true,
       editor:"text",
       css:"doc_tree",
       id:"docTree",
       width:300,
       select:true,
       on:{
        
        onBeforeSelect:function(id)
         {
         return !this.getItem(id).$count;
        
      },
      onAfterSelect:function(id){
        $$("pdf").clear();
        $$("pdf").load("binary->files/"+this.getItem(id).url).fail(function(){
            webix.message({text:"Missing file",type:"error"});
            
         });
          },
        onAfterAdd:function(id){
        this.blockEvent();
        this.select(id);
        this.unblockEvent();
        
        }
        },

     //data:recordsData,
     drag:true,
     url: "data/files.php",
     datatype: "json",
      type:"lineTree",
      filterMode:{
        showSubItems:true,
        level:5
      },
   
   
       };

javascript
my pdf viewer script

       var pdfView ={
        rows:[
         {
          view:"pdfbar" ,
          id:"pdf",
          css:"pdf_toolbar",
          paddingY:10
            
         },
         {
            view:"pdfviewer",
            url:"binary->files/",
            id:"pdf",
            toolbar:"pdfbar",
            css:"pdf_viewer"
            
          }
        
          ]
    
    
          };

perhaps you are not using PRO version
https://docs.webix.com/desktop__pdfviewer.html

Hello @emmanuel ,
Actually, PDF Viewer is available in the Webix Pro edition. So if you use PRO version but the widget still does not work, please, describe the error which appears on the console in a browser. Which browser do you use?
Here is a snippet of your implementation: https://snippet.webix.com/giq8dwh1

oh okay thanks i didn’t not know it was not available, am not using web-ix pro, but i have another question in line with the same

I am building an application in webix that is going to allow users to upload document files, so I have a javascript and a PHP script,

Javascript

 var uploader = {
    view:"uploader",
    //id:"upload", 
    label:"Select file to upload",
    upload:"docs/upload.php",
    accept:"application/pdf",
    icon:"upload",
    datatype:"json",
    on:{
        // additionally send path
        onAfterFileAdd:function(upload){$$("docTree").add({ value:upload.file.name, docurl:upload.file.name});
        $$("pdf").parsel(upload.file);
    },
}

PHP

                     <?php
    ini_set('max_execution_time',120);
    $destinatioin = realpath("/opt/lampp/htdocs/site2/files/");
    if(isset($_FILES['upload'])){
        $file = $_FILES['upload'];
        $filename = $destinatioin."/".preg_replace("|[\\\\\\/]|","",$file["name"]);
        $sname = md5($file["name"]);
        //cheak that file name is vaild
        if($filename !== ""){
            if(file_exists($filename))unlink($filename);
            move_uploaded_file($file["tmp_name"], $filename);
            $res = array("status" => "server",  "sname" => $sname);
            echo '{ "status": "server", "sname":"$sname"}';
        }else{
            $res =array("status" => "error");
        }
        echo json_encode($res);
    }
?>

Q1 - I am using Linux how can one add a real path for folders in the root

Q2 - Files are not been uploaded, I want to upload files to my files folder how do i manage to do that, files are not moving to the uploads folder

The answer to this question is here