开发者

More than one file type in Uploadify

开发者 https://www.devze.com 2023-01-31 10:39 出处:网络
I\'m searching for a solution for havinig different file types in the jQuery plugin Uploadify. Think about the following prozedure: You want to open a file with a program of your choice. Starting wit

I'm searching for a solution for havinig different file types in the jQuery plugin Uploadify.

Think about the following prozedure: You want to open a file with a program of your choice. Starting with a default OS-Dialog you can select different file types in a dropdown menu splitted in different extensions for their types. For开发者_StackOverflow社区 example audio files (*.mp3, .ogg), image files (.jpeg, *.gif), etc. I know the options fileExt and fileDesc but I can't find the right way to implement this special feature with this options.

I also know FancyUpload for mootools, where I can define different types, but don't want to use a second framework for JavaScript.

Thanks for your help.

Lemmi


Try this:

 <script type="text/javascript">
       // <![CDATA[
       $(document).ready(function() {
       $('#fileInput').uploadify({
       'uploader': 'uploadify/uploadify.swf',
       'script': 'Upload.ashx',
       'scriptData': { 'id': 1, 'foo': 'test'},
       'cancelImg': 'uploadify/cancel.png',
       'auto': true,
       'multi': true,
       'fileDesc': 'Image Files', //<-- This can be whatever you want
       'fileExt': '*.jpg;*.png;*.gif;*.bmp;*.jpeg',  //<-- Answer Here
       'queueSizeLimit': 90,
       'sizeLimit': 4000000,
       'buttonText': 'Choose Images',
       'folder': '/uploads',
       'onAllComplete': function(event, queueID, fileObj, response, data) {

       }
     });
   });
   // ]]>
  </script>

   <input id="fileInput" name="fileInput" type="file" />
0

精彩评论

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

关注公众号