开发者

How to add more file types to the FancyUpload plugin?

开发者 https://www.devze.com 2023-03-21 22:39 出处:网络
I am trying to modify the FancyUpload plugin to accept the following files extensions. *.jpg *.jpeg *.txt

I am trying to modify the FancyUpload plugin to accept the following files extensions.

  • *.jpg
  • *.jpeg
  • *.txt
  • *.gif
  • *.png
  • *.doc
  • *.docx
  • *.pdf
  • *.xlsx
  • *.ppt
  • *.pdf

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

0

精彩评论

暂无评论...
验证码 换一张
取 消