1. #121
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,173
    Vote Rating
    82
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    I provide complete PHP backend, same as demo page is served by, on an individual basis for a donation and w/o any support, questions or warranty.

    These links should help you to write your own PHP backend if that is not an option for you:

    http://www.php.net/manual/en/features.file-upload.php
    http://filetree.extjs.eu

  2. #122
    Ext User spectrus's Avatar
    Join Date
    Feb 2008
    Posts
    43
    Vote Rating
    0
    spectrus is on a distinguished road

      0  

    Question attaching a listener to the uploader?

    attaching a listener to the uploader?


    Hello,

    Trying to use the UploadPanel for a slightly different purpose: parsing Excel files, i.e. user adds a file to the list and when 'upload' is clicked file is processed on the server. What I can't figure out is how to catch the AJAX response, since I want to show the user a grid with all the data from the spreadsheet(s). I think it's just a matter of attaching a listener (and I see the 'allfinished' event in the FileUploader), but attach it to what? All I ever do in my code is declare the upload panel, without ever touching the FileUploader:

    PHP Code:
    {
        
    xtype:'uploadpanel'
        
    ,buttonsAt:'tbar'
        
    ,id:'card-0'
        
    ,url:'php/filetree.php'
        
    ,path:'root'
        
    ,maxFileSize:1048576
        
    ,maxLength:28
        
    ,singleUpload:true

    Any tips?

    Thanks in advance!

  3. #123
    Ext User spectrus's Avatar
    Join Date
    Feb 2008
    Posts
    43
    Vote Rating
    0
    spectrus is on a distinguished road

      0  

    Default


    Well, it seems that attaching a 'allfinished' listener directly to the uploadpanel seems to work, and inside it I have acces to the FileUploader object.

    Still not sure what I could do with it to get to the response from the server side, though...

  4. #124
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,173
    Vote Rating
    82
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    You will need to extend/override FileUploader processSuccess/Failure methods where the raw response is available.

  5. #125
    Sencha User cmendez21's Avatar
    Join Date
    Jun 2007
    Location
    Mexico D.F.
    Posts
    475
    Vote Rating
    0
    cmendez21 is on a distinguished road

      0  

    Default


    Hi SAKI

    after 28 straight hours and i've gotten the upload to work but almost everything works fine except the download function.

    I have created a script which downloads the file if its called externally and works
    but when i use it in the tree panel i got this error ** in Firefox (firebug) , also i tried in you demo page and i get the same error is it a bug ??

    the response i use after the the download code it's or maybe i dont know how to handle the response (as a matter of fact it hasn't to be a response code cause the invisible form which passes the parameters submits and then get erased )

    So meanwhile i suspend ( // ) the download button from the JS file

    The error occurs when i press the ok button from the dialog that appears to save the download

    ** Error
    [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIInterfaceRequestor.getInterface]" nsresult: "0x80004002 (NS_NOINTERFACE)" location: "JS frame :: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsHelperAppDlg.js :: anonymous :: line 147" data: no]
    file:///C:/Program%20Files/Mozilla%20Firefox/components/nsHelperAppDlg.js
    Line 147



    Also a sugestion:
    1.- it be nice if we could tell which types of file can upload (i mean i can in the php file but to restrict access from the tree panel )
    2.- To handle more paths cause i've testing in a estructure like this

    FOLDER APP
    |------>Ext
    |------>Libs
    |------>Libs----->filetree
    |-----imgsfolder
    |------>imgs
    index.htm

    so if i go backwards filetree with folder imgs the parameters it passes are erased int he path ../../imgs/
    but if i use imgsfolder it works fine

    3.- the progress php does it have any real function right for the moment?

  6. #126
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,173
    Vote Rating
    82
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    1) you do not need anything special for download - it is one of the open modes. The only point is that server need to return correct headers and data.

    2.1) I'll take a look if it is possible with standard html input, or it can be limited by UploadPanel code.
    2.2) I'm not quite sure what you mean. rootVisible:false? Try, I haven't.

    3) Yes, but due to the limitation of pecl uploadprogress extension it works (on demo page) only if you upload single file. It would also work if you had singleUpload:true where you upload files all in one form.

  7. #127
    Ext User
    Join Date
    Mar 2008
    Posts
    11
    Vote Rating
    0
    mlim1972 is on a distinguished road

      0  

    Default


    Quote Originally Posted by jsakalos View Post
    I'll take a look soon and I'll let you know.
    Looking closely at the 'cmd:get' not coming to the server, I added a line to make it go to the server:
    Code:
    		// create loader
    		if(!this.loader) {
    			this.loader = new Ext.tree.TreeLoader({
    				 url:this.url
    				,baseParams:{cmd:'get'}
    				,listeners:{
    					beforeload:{scope:this, fn:function(loader, node) {
    						loader.baseParams.path = this.getPath(node);
    						loader.baseParams.cmd = 'get';
    					}}
    				}
    			});
    		}

  8. #128
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,173
    Vote Rating
    82
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    That shouldn't be necessary. I've tested demo page and haven't found any problems. Any precise steps to reproduce?

  9. #129
    Sencha User cmendez21's Avatar
    Join Date
    Jun 2007
    Location
    Mexico D.F.
    Posts
    475
    Vote Rating
    0
    cmendez21 is on a distinguished road

      0  

    Talking


    Hi Saki, Check this out

    http://extjs.com/forum/showthread.php?t=31329

    I made a custom mod for the file tree panel so i can link a hiddenfield and div tag to the file tree panel (jpg, gif, png and bmp ) files only

  10. #130
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,173
    Vote Rating
    82
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    Perfect! I like it very much.

    Have you tried to hide root? And, I still don't know how to limit extensions...