swfupload not working under IE anymore

前提是你 提交于 2019-11-30 19:29:34

I could reproduce the problem with IE9 running on Windows 7, but only on virtual machines. Anyway, I was able to apply a quick'n'dirty to fix the problem by patching swfupload.js (v2.2.0), somewhere around line 230, thanks to this post.

SWFUpload.prototype.getFlashHTML = function () {
    // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay

    // ADD THESE LINES --> 
    var iefix = '';
    if(navigator.userAgent.search(/MSIE/) > -1){
        iefix = 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
    }

    // MODIFY THIS LINE: (add ' + iefix + ')
    return ['<object ' + iefix + ' id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
        '<param name="wmode" value="', this.settings.button_window_mode, '" />',
        ...

Seems that a very similar fix might help for 2.5.0.

EDIT: it seems that this fix wasn't enough for some VM's that have an IE add-on called "VMware Adobe Flash Optimizer" enabled. For some reason, the optimizer turns the Flash movie to a white box (which is actually clickable if you know to click it).

The bad news is that I found no way to detect or disable the presence of the optimizer add-on in my code. So I can't be sure whether the user actually sees the button or only a white box. I found no good workaround, only added a fallback link to a non-Flash uploading form.

It is not only you who has the problem. It is also on the swfuploader website itself. Take a look: http://demo.swfupload.org/v220/simpledemo/index.php

You may have an add-on that is getting in the way. Try running IE 8 in "No Add-Ons" mode. From http://support.microsoft.com/kb/936213:

"Method 3: Run Internet Explorer in "No Add-Ons" mode

Internet Explorer add-ons, such as ActiveX controls and browser toolbars, are used by some Web sites to provide an enhanced browsing experience. An error may occur if an add-on is damaged or if an add-on conflicts with Internet Explorer. To determine whether the error is caused by an add-on, run Internet Explorer in "No Add-Ons" mode. To do this, follow these steps:

  1. Click Start, and then type Internet Explorer in the Start Search box.
  2. Click Internet Explorer (No Add-Ons). Internet Explorer opens without add-ons, toolbars, or plug-ins.
  3. Test Internet Explorer to verify that it works correctly. If issues still occur, try Method 4.

If no errors occur, the problem is caused by one of the add-ons that typically load together with Internet Explorer. In this case, use one of the following options.

Option 1: Reset Internet Explorer

Reset Internet Explorer to its default configuration. This step will also disable any add-ons, plug-ins, or toolbars that are installed. Although this solution is quick, it also means that, if you want to use any of those add-ons in the future, they must be reinstalled. To reset Internet Explorer settings, use Method 4.

Option 2: Use the Manage Add-ons tool to determine which add-on is causing the issue

Use the Manage Add-ons tool in Internet Explorer to individually disable each add-on to determine which add-on is causing errors. To do this, follow these steps:

Internet Explorer 8

  1. Open Internet Explorer 8.
  2. Click Tools, and then click Manage Add-ons.
  3. On the Show drop-down menu, select All add-ons to display all add-ons that are installed on the computer.
  4. For each item in this list, select the add-on, and then click Disable in the Information window.
  5. When you have disabled all the items in this list, click OK.
  6. Exit and then restart Internet Explorer.
  7. If issues do not reoccur, repeat steps 1 through 3.
  8. Click Enable for a single add-on.
  9. Repeat steps 6 through 8 until you determine which add-on causes errors to occur.

After you have used this process to determine which add-on is causing errors, you can disable that add-on. Or, you can uninstall the software that installs the add-on. We also recommend that you contact the software vendor that provided the add-on for additional troubleshooting and support."

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