Uploadify updateSettings problems

放肆的年华 提交于 2019-12-02 09:54:17

You code is wrong. Uploadify cannot binded to a <input type="file">, only to a <div/>. See the documentation and the example in the uploadify site.

To have progressive enhancement, I have both element, <input type="file"/> and an empty <div/>. Then in javascript code, I remove the input element and then initialize uploadify.

<input type="file" name="uploadify" />
<div id="uploadify"></div>

<script type="text/javascript">
    jQuery(function($){
      $("input[name='uploadify']").hide().remove();
      $("#uploadify").uploadify({UPLOADIFY_PARAM});
      //a click handler to change uploadify param
      //...
    });
    </script>

Btw, I never consider the folder parameter from uploadify. I define the upload folder in the server side scripting.

Maik

Try a different function name. I had a similar problem and found out that renaming updateSettings() to updateForm() solved the issue in my case.

I got this error when using Uploadify inside a jquery dialog box.

The solution was to initialize Uploadify after the dialog was created.

jinn

I've encountered the same problem. It seems that there's a bug with auto:true, as I have another uploadify on the same page, with auto:false, and uploadifySettings works perfectly.

I've made a workaround:

  • set auto to false
  • onSelect, submit the upload, like this:

    ... 'onSelect' : function(event, data){ $('#someID').uploadifySettings('param', 'value'); $('#someID').uploadifyUpload(); } ...

hth

I received this error in Chrome when the uploadify control was inside a jquery dialog.

I ended up not using uploadify and switched to jQuery Upload File Plugin http://hayageek.com/docs/jquery-upload-file.php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!