1. #801
    Ext User
    Join Date
    Jul 2009
    Posts
    3
    Vote Rating
    0
    rkulkarni is on a distinguished road

      0  

    Default


    Thanks Piyush!! Really appreciate your help!!

  2. #802
    Ext User
    Join Date
    Mar 2010
    Posts
    11
    Vote Rating
    0
    cybervirax is on a distinguished road

      0  

    Lightbulb


    Thx really for this ext3.x compatibilty.

    I make a php interpretor ... with some bonus like:
    - hidden file
    - extension ...

    this is hardcoding and not really optimize. I have a problem to get the ext-gen upload for error (not in file/get/post)... a bug?

    For the code (I will post a real vers. soon) :

    PHP Code:
    <? 

    define
    ('DS'DIRECTORY_SEPARATOR);
    $file_accepted = array("ico","js","png","gif","jpg","jpeg","pdf");

    function 
    dd($date) {
       return 
    date("d/m/Y H:i:s",$date);
    }

        function 
    recursiveDelete($str){
            if(
    is_file($str)){
                return @
    unlink($str);
            }
            elseif(
    is_dir($str)){
                
    $scan glob(rtrim($str,'/').'/*');
                foreach(
    $scan as $index=>$path){
                    
    recursiveDelete($path);
                }
                return @
    rmdir($str);
            }
        }
        

    if(
    $_POST['cmd']) {
        
    $cmd $_POST['cmd'];
    }



    if(
    $cmd === 'get') {
        
        if(isset(
    $_POST['path'])){
            
    $rep .= $_POST['path'] . DS;
        };
        
    $dir opendir($rep);
        
    $array = array();
        while (
    $f readdir($dir)) {
          if(
    $f!='..' && $f!='.') {
            if(
    is_file($rep.$f) && in_array(substr(strrchr($f'.'), 1),$file_accepted)) {
                    
    $ext substr(strrchr($f'.'), 1);
                    
    $icon "file-".$ext;
                    
    array_push($array,array(
                        
    "text"=>$f,
                        
    "iconCls"=>$icon,
                        
    "disabled"=>false,
                        
    "leaf"=>true,
                        
    "mode"=>'_self',
                        
    "qtip"=>"<b>Taille : </b>".filesize($rep.$f)." octets<br /><b>Modifié le : </b>".dd(filemtime($rep.$f))
                        )
                    );
            };
            if(
    is_dir($rep.$f) && $f[0]!= '.') {
                
    array_push($array,array(
                    
    "text"=>$f,
                    
    "iconcls"=>"folder",
                    
    "disabled"=>false,
                    
    "leaf"=>false
                    
    )
            );
            };
          };
        };
        
        echo 
    json_encode($array);
    }
    if (
    $cmd === 'rename') {
        if(
    $_POST['newname'] && $_POST['oldname']) {
            
    $newname $_POST['newname'];
            
    $oldname $_POST['oldname'];
            
    rename($oldname$newname);
            echo 
    '{"success":true}';
        } else {
            echo 
    '{"success":false,"errors":"Impossible de renommer"}';
        }
    }
    if (
    $cmd === 'newdir') {
        if(
    $_POST['dir']) {
            
    $dir $_POST['dir'];
            
    mkdir($dir);
            echo 
    '{"success":true}';
        } else {
            echo 
    '{"success":false,"errors":"Impossible de créer le dossier"}';
        }
    }
    if (
    $cmd === 'delete') {
        if(
    $_POST['file']) {
            
    $file $_POST['file'];
            
    recursiveDelete($file);
            echo 
    '{"success":true}';
        } else {
            echo 
    '{"success":false,"errors":"Impossible de supprimer le dossier"}';
        }
    }



    if (
    $cmd === 'upload') {
        if(
    $_POST['path']) {
            
    $path $_POST['path'];
        }
        
        
    $uploaddir $pathDS;
        
    $uploadfile $uploaddir basename($_FILES['x-filename']['name']);

        if(
    $_FILES['x-filename'] && in_array(substr(strrchr($_FILES['x-filename']['name'], '.'), 1),$file_accepted)) {
            if (
    move_uploaded_file($_FILES['x-filename']['tmp_name'], $uploadfile)) {
                echo 
    '{"success":true}';
            };
        } else {
            echo 
    '{"success":false,"errors":{"ext-gen65":"File uggfggegdgdfgdggdfggdfpload error."}}';
    // Here, where is the ext-gen var? I make some print_r with no result :'(, firebug show nothing...
        
    }
    }




    ?>
    if you use the code... be carefull

  3. #803
    Sencha User kender's Avatar
    Join Date
    Jul 2009
    Location
    Italy
    Posts
    23
    Vote Rating
    0
    kender is on a distinguished road

      0  

    Default


    Hi, thanks again for this plugin...

    replying to cybervirax, for the field ID used by response (in case of error) I made this change:

    File: Ext.ux.FileUploader.js
    From:
    Code:
    // append input to the form
            var inp = record.get('input');
            //inp.set({name:inp.id});
            inp.set({name: "x-filename"});
            form.appendChild(inp);
    To:
    Code:
    // append input to the form
            var inp = record.get('input');
            inp.set({name:inp.id});
            //inp.set({name: "x-filename"});
            form.appendChild(inp);
    For server-side part (PHP), I used this:
    PHP Code:
    foreach( $_FILES as $k=>$v ) {
        
    $myFileName $v['name'];
        
    $myTempName $v['tmp_name'];
        
    $myFileSize $v['size'];
        
    $inputID    $k;
    }
    [...] 
    // error
    $resp['success'] = false;
    $resp['errors'][$inputID]    = "error during upload";
    echo 
    json_encode$resp ); 
    the response will be, for example:
    Code:
    
    {"success":false,"errors":{"ext-gen327":"error during upload"}}
    [EDIT]
    How to make a callback after files are uploaded successfully?
    Ok, I reply to myself :
    using ".on( "allfinished" ) event seems to work
    Last edited by kender; 14 Jun 2010 at 2:31 AM. Reason: question about callback + reply
    Kender is not a thief!

  4. #804
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    378
    Vote Rating
    2
    silcreval is on a distinguished road

      0  

    Default


    I'd like to use the progress feature for the Upload, and I've noticed that as the file
    is uploaded, requests are made to the server for a file progress.php.

    I have uploadprogress installed in the PHP server, but just wondered what to return?

    Looking on the web in general on this it seems a bit of a mystery - does anyone have
    like a small bit of php that would work with the tree control. I'm assuming that the
    php script calls upload_progress in some way, and then returns a JSON packet, or
    is there something else I need to do?

    Thanks

    Ian

  5. #805
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,536
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    PHP upload progress is pain in the a.. I'd probably use PERL or another language to implement a bullet proof upload progress indication.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  6. #806
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    378
    Vote Rating
    2
    silcreval is on a distinguished road

      0  

    Default


    Ouch - unfortunately my server side is all PHP so its not really possible. Also I'm much
    more confident with PHP.

  7. #807
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,536
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Me too - I've made it working once but the whole solution is very vulnerable. I believe that there must be a perl uploader so you wouldn't need to code it yourself in perl. Also, everything else can stay PHP; you can also access the uploaded file with PHP - only the uploader itself could be PERL (or python, whatever that provides a decent upload progress).
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  8. #808
    Sencha User
    Join Date
    Sep 2007
    Posts
    98
    Vote Rating
    1
    adam.jimenez is on a distinguished road

      0  

    Default


    When I create a new file it fires a newfile event AND a rename event.
    I'm using the latest version of Ext.

    The rename event fails because the newfile event has already actioned.

    Has anyone else had this issue?

    I'm hoping there will be a new beta - it's a fantastic component.

  9. #809
    Sencha User
    Join Date
    Mar 2010
    Posts
    5
    Vote Rating
    0
    tumbochka is on a distinguished road

      0  

    Default


    Hi!
    I'm trying to use your UploadPanel to upload images to server.
    I initialize the Panel like this:
    PHP Code:
              items: [{
                
    xtype'uploadpanel',
                
    maxFileSize10000000,
                
    url"/orders/services/utils/uploadimage?product="+this.ownerCt.ownerCt.product.data.id
               
    }] 
    On server side I write java-code:
    @RequestMapping(value = "/utils/uploadimage", method= RequestMethod.POST)
    public void uploadImage(@RequestParam MultipartFile image, @RequestParam ProductPrototype product) throws IOException{
    ...........
    }
    Java says that the request doesn't have parameter "image".
    What can I do to fix this error?

  10. #810
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,536
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    No idea. I don't use Java at server, I use LAMP servers.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


Thread Participants: 173

  1. danvega (10 Posts)
  2. jay@moduscreate.com (1 Post)
  3. jweber (1 Post)
  4. jt (1 Post)
  5. slacker775 (2 Posts)
  6. vmorale4 (12 Posts)
  7. stever (2 Posts)
  8. Dumbledore (9 Posts)
  9. ismoore (1 Post)
  10. mystix (8 Posts)
  11. sdrew (3 Posts)
  12. mxracer (1 Post)
  13. Foggy (3 Posts)
  14. madrabaz (8 Posts)
  15. Thorsten (4 Posts)
  16. Fabyo (1 Post)
  17. mschaefer (11 Posts)
  18. tchitani (3 Posts)
  19. loeppky (11 Posts)
  20. damsfx (1 Post)
  21. cmendez21 (7 Posts)
  22. anjelika (3 Posts)
  23. randcasburn (3 Posts)
  24. mjlecomte (3 Posts)
  25. esoteric (10 Posts)
  26. pravin_bluebird (1 Post)
  27. ZooKeeper (4 Posts)
  28. george.antoniadis (1 Post)
  29. fermo111 (1 Post)
  30. glaforge (2 Posts)
  31. Spirit (1 Post)
  32. newc_k (1 Post)
  33. adam.jimenez (9 Posts)
  34. juandj (10 Posts)
  35. rballman (2 Posts)
  36. Michelangelo (6 Posts)
  37. kk_kkk (7 Posts)
  38. issomesmo (5 Posts)
  39. mashiki (1 Post)
  40. juljupy (2 Posts)
  41. cafebabe (1 Post)
  42. ferrenliu (1 Post)
  43. smartlit (14 Posts)
  44. chunkT (1 Post)
  45. mankz (6 Posts)
  46. luisparada (4 Posts)
  47. iDevelopment (4 Posts)
  48. cblin (9 Posts)
  49. ljaeren (2 Posts)
  50. endlichstudent (9 Posts)
  51. RacingTomcat (1 Post)
  52. lobo-tuerto (5 Posts)
  53. maximumcoder (1 Post)
  54. calavera (3 Posts)
  55. ningle (5 Posts)
  56. jbird526 (4 Posts)
  57. sekundek (8 Posts)
  58. GokhanNL (1 Post)
  59. markkl (1 Post)
  60. basshcm (2 Posts)
  61. dbraiden (2 Posts)
  62. incaic (2 Posts)
  63. silcreval (6 Posts)
  64. sirioz10 (2 Posts)
  65. iulian (2 Posts)
  66. hsurya (7 Posts)
  67. johnrembo (2 Posts)
  68. fraric (4 Posts)
  69. Silver Paladin (5 Posts)
  70. Rafael (2 Posts)
  71. treqx (1 Post)
  72. spectrus (6 Posts)
  73. JoyfulBobHome (2 Posts)
  74. fxlacroix (3 Posts)
  75. jove4015 (1 Post)
  76. rtrocc (12 Posts)
  77. carl23934 (1 Post)
  78. ClemsonJeeper (1 Post)
  79. lagos.tout (2 Posts)
  80. craigharmonic (3 Posts)
  81. siebertm (3 Posts)
  82. zombeerose (11 Posts)
  83. keckeroo (1 Post)
  84. dotchris (7 Posts)
  85. fallenone (4 Posts)
  86. yhwh (1 Post)
  87. harirama (2 Posts)
  88. scroll (1 Post)
  89. mlim1972 (4 Posts)
  90. Arthur.Blake (1 Post)
  91. nileshgund (1 Post)
  92. blow (1 Post)
  93. piyushjain7 (1 Post)
  94. njeriextjs (3 Posts)
  95. hileon (1 Post)
  96. bomka (15 Posts)
  97. --maty (1 Post)
  98. WhiteRussian (1 Post)
  99. kpopov (1 Post)
  100. captainfish (5 Posts)
  101. Gosa (5 Posts)
  102. extjsF4n (1 Post)
  103. Chida (1 Post)
  104. Nthalk (2 Posts)
  105. nescha (2 Posts)
  106. jorgemuza (3 Posts)
  107. Eric24 (1 Post)
  108. edui (1 Post)
  109. shadoi (4 Posts)
  110. acidfilez (1 Post)
  111. BrainDrain (2 Posts)
  112. dimitrij.zub (1 Post)
  113. ixnixnixn (2 Posts)
  114. calicoder (2 Posts)
  115. wes (1 Post)
  116. mammerman (1 Post)
  117. Voronchuk (3 Posts)
  118. jwmianzu (3 Posts)
  119. gnomie (2 Posts)
  120. pflammer (2 Posts)
  121. The0s (2 Posts)
  122. gogogo521 (1 Post)
  123. tegel (2 Posts)
  124. wulfshayde (2 Posts)
  125. mikecx (2 Posts)
  126. paul@demiduk.com (1 Post)
  127. romulodelazzari (1 Post)
  128. sabline (2 Posts)
  129. mikecc (8 Posts)
  130. dan.plifeye (2 Posts)
  131. JGALFO (1 Post)
  132. Stephan Schrade (3 Posts)
  133. khurri.saleem (1 Post)
  134. voidus (1 Post)
  135. Shockdoc1 (1 Post)
  136. dport (3 Posts)
  137. jahman (3 Posts)
  138. Pachat (4 Posts)
  139. BIS (1 Post)
  140. sanraj (4 Posts)
  141. deemonas (1 Post)
  142. jpipas (2 Posts)
  143. martinrame (2 Posts)
  144. MrEnirO (2 Posts)
  145. elona (1 Post)
  146. cwford (6 Posts)
  147. triptonemeister (2 Posts)
  148. gonzalez (1 Post)
  149. wallacer (1 Post)
  150. Natalie (2 Posts)
  151. Phatnine (2 Posts)
  152. js_coder (3 Posts)
  153. Bobrovnik (4 Posts)
  154. kender (1 Post)
  155. avsomeren (2 Posts)
  156. rkulkarni (2 Posts)
  157. lxfliu (2 Posts)
  158. pbaker99 (2 Posts)
  159. naf305 (2 Posts)
  160. cybervirax (1 Post)
  161. AmrMostafa (1 Post)
  162. tumbochka (1 Post)
  163. exdelierium (1 Post)
  164. toubeau (4 Posts)
  165. nosferatum (1 Post)
  166. Boy.Kortman (1 Post)
  167. erlinis (1 Post)
  168. nhocoi (2 Posts)
  169. varunach (1 Post)
  170. _DR_ (1 Post)
  171. rodenp (1 Post)
  172. tutuianu_daniel (1 Post)
  173. Shabneez (2 Posts)