I am trying to modify the FancyUpload plugin to accept the following files extensions.
- *.jpg
- *.jpeg
- *.txt
- *.gif
- *.png
- *.doc
- *.docx
- *.xlsx
- *.ppt
I have already searcher, but all the topics about this are outdated, and it doesn't work. This plugin has two files, index.php
and scrip.js
, where there are the same filter. I have already changed that with this but nothing w开发者_开发百科orks.
This is what I have tried so far:
index.php
$('demo-browse').addEvent('click', function() {
swiffy.browse();
return false;
});
$('demo-select-images').addEvent('change', function() {
var filter = null;
if (this.checked) {
filter = {'docs (*.jpg, *.jpeg, *.txt, *.gif, *.png, *.doc, *.docx, *.pdf, *.xlsx, *.ppt, *.pdf)': '*.jpg; *.jpeg; *.txt; *.gif';*.png, *.docx, *.pdf;*.xlsx;*.ppt;*.pdf};
//filter = {'Images (*.jpg, *.jpeg, *.gif, *.png)': '*.jpg; *.jpeg; *.gif; *.png'};
}
swiffy.options.typeFilter = filter;
});
script.js
$('demo-browse').addEvent('click', function() {
swiffy.browse();
return false;
});
*/
$('demo-select-images').addEvent('change', function() {
var filter = null;
if (this.checked) {
filter = {'docs (*.jpg, *.jpeg, *.txt, *.gif, *.png, *.doc, *.docx, *.pdf, *.xlsx, *.ppt, *.pdf)': '*.jpg; *.jpeg; *.txt; *.gif';*.png, *.docx, *.pdf;*.xlsx;*.ppt;*.pdf};
//filter = {'Images (*.jpg, *.jpeg, *.gif, *.png)': '*.jpg; *.jpeg; *.gif; *.png'};
}
swiffy.options.typeFilter = filter;
});
Just visited this page, and copy the script there: solution, but I still dont figure out other things but well, fancyupload has a avandced coding
精彩评论