How to avoid the upload button for SwfUpload on IE10

Source: Internet
Author: User

During the system test, we found that the refreshing upload function implemented by SwfUpload was unavailable on IE10. Isn't SwfUpload supported? Or another implementation method is required? Finally, we can modify the SwfUplad. JS file to support IE10. The specific solution is as follows:

Open SwfUpload. js, find the/Private: getFlashHTML generates the object tag needed to embed the flash in to the document "line and" // Private: getFlashVars builds the parameter string that will be passed "and this line, and then replace the intermediate code with the following code.

Copy codeThe Code is as follows:
SWFUpload. prototype. getFlashHTML = function (flashVersion ){
// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
Var classid = "";
Var Sys = {};
Var ua = navigator. userAgent. toLowerCase ();
If (window. ActiveXObject ){
Sys. ie = ua. match (/msie ([\ d.] +)/) [1];
If (Sys. ie & Sys. ie. substring (0, 1) = "9" | Sys. ie. substring (0, 2) = "10 "){
Classid = 'classid = "clsid: d27cdb6e-ae6d-11cf-96b8-444553540000 "';
}
}
Return ['<object', classid, 'Id = "', this. movieName, '"type =" application/x-shockwave-flash "data ="', (this. support. imageResize? This. settings. flash_url: this. settings. flash9_url), '"width ="', this. settings. button_width, '"height ="', this. settings. button_height, '"class =" swfupload "> ',
'<Param name = "wmode" value = "', this. settings. button_window_mode, '"/> ',
'<Param name = "movie" value = "', (this. support. imageResize? This. settings. flash_url: this. settings. flash9_url), '"/> ',
'<Param name = "quality" value = "high"/> ',
'<Param name = "allowScriptAccess" value = "always"/> ',
'<Param name = "flashvars" value = "' + this. getFlashVars () + '"/> ',
'</Object>']. join ("");
};

Save and run it to see the effect. It's perfect!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.