-
2 Apr 2008 8:24 AM #121
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.euJozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
2 Apr 2008 11:44 AM #122
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:
Any tips?PHP Code:{
xtype:'uploadpanel'
,buttonsAt:'tbar'
,id:'card-0'
,url:'php/filetree.php'
,path:'root'
,maxFileSize:1048576
,maxLength:28
,singleUpload:true
}
Thanks in advance!
-
2 Apr 2008 12:40 PM #123
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...
-
2 Apr 2008 1:10 PM #124
You will need to extend/override FileUploader processSuccess/Failure methods where the raw response is available.
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
2 Apr 2008 6:54 PM #125
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?
-
2 Apr 2008 7:25 PM #126
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.Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
2 Apr 2008 7:52 PM #127
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'; }} } }); }
-
3 Apr 2008 2:57 AM #128
That shouldn't be necessary. I've tested demo page and haven't found any problems. Any precise steps to reproduce?
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
3 Apr 2008 5:27 AM #129
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
-
3 Apr 2008 6:24 AM #130
Perfect! I like it very much.



Have you tried to hide root? And, I still don't know how to limit extensions...Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video


Reply With Quote
