Jozef Sakalos, aka Saki
Education, extensions and services for developers at new http://extjs.eu
News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy
jsakalos
Great extension
I have been messing around with it today and wondered if there was a way to limit the file types that can be uploaded?
Cheers
Alex
P.S I am actaully using the tree but since its related to the ploads thought I would post the question here
Regards
Alex
You want it done when !!!!
Not in standard uploader. It uses just <input type="file"> and AFAIK there is no possibility to limit file type. It's possible with SWFUpload but it's unstable and therefore I dropped it.
What could be done is to check file extension AFTER user selects a forbidden file type. Quite awkward but you can try if you cannot live w/o it.![]()
Jozef Sakalos, aka Saki
Education, extensions and services for developers at new http://extjs.eu
News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy
Override onFileAdded method. Input type=file value is read-only so you will need to delete inp passed as argument and create new blank one with createUploadInput method.
Jozef Sakalos, aka Saki
Education, extensions and services for developers at new http://extjs.eu
News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy
Problems getting it to work. Am I missing something simple?
Step 1: Downloaded the Ext.ux.UploadForm.js file.
Step 2: setup the test case for the upload form
Step 3: Made a test_upload_form.php to do something with the files uploaded.
Everything seems to want to work except no post or file data looks to be sent.
I get nothing in my array when I print_r my $_FILES and $_POST vars.PHP Code:
var f2 = new Ext.ux.UploadForm('float-form-ct', {
autoCreate: true
, iconPath: '../../resources/images/uploadform'
, floating: true
, url: 'scripts/test_upload_file.php'
, method: 'post'
, baseParams: {
cmd:'upload'
, path: 'root'
}
});
Is there something I stupid I am missing? This is all I do for a normal multipart/form-data.
If I can get this running jsakalos I will be happy to donate some money toward the use of the widgit.
Note: I have tested it with "get" and the baseParams come through but all the other stuff is empty.
Mike Giddens
=======================
Opportunity is missed by most people because it is dressed in overalls and looks like work - Thomas Edison
Jozef Sakalos, aka Saki
Education, extensions and services for developers at new http://extjs.eu
News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy
Thanks for the help.
NOTE FOR OTHER USERS:
Firebug will not help in testing your upload script on your server side. The upload form uses a iframe which does not send back a response equal to what is actually being sent and recieved.
I recommend making a static test form that calls the same script so that you can see what is actualy happening on the server side. Once you are happy with your results switch to the file_upload script and everything should be good.
=========================
Extension Recommendation:
If you wanted to make this a little bit more advanced I would try and create forms for each file and send the requests seperatly so that you can have more control over the upload process. Right now all the files go in one iframe form session and I can just stop one I have to stop the whole process and not sure what has been compelted and what has not. If I ever get some time I might look into changing it up to work this way.
I am still happy with it and grateful for your programming skills.
Possible bug?
I am getting an extra file that has blank everything in php when I loop through my $_FILES. I have not stepped through your extension but if I find anything out I will let you know.
====================
One question:
Is this the pecl package I need to install on PHP 5.2 to get the progress.php to work?
http://pecl.php.net/package/uploadprogress
Mike Giddens
=======================
Opportunity is missed by most people because it is dressed in overalls and looks like work - Thomas Edison
Yes, this could be done, nevertheless I'm now quite busy so I'll go into this only if there is a big need for it. If you want you're welcome to either extend the UploadForm or change it.
thx
I am still happy with it and grateful for your programming skills.
This is feature not a bug. It's written in interface documentation for FileTreePanel. Very last line on http://aariadne.com/filetreePossible bug?
I am getting an extra file that has blank everything in php when I loop through my $_FILES. I have not stepped through your extension but if I find anything out I will let you know.
Yes, it is that.====================
One question:
Is this the pecl package I need to install on PHP 5.2 to get the progress.php to work?
http://pecl.php.net/package/uploadprogress
Cheers,
Jozef Sakalos, aka Saki
Education, extensions and services for developers at new http://extjs.eu
News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy