开发者

SwfUpload Fallback for clients without Flash

Im currently using the SwfUpload (v2.2.0.1) on my asp.net web application with absolutely no issues.

What I would like to do is provide a fall back to a normal upload when the user/client does not have flash installed. I can imagine this could be done with something like jquery replace or similar with the use of a flash detection script.

I do not need to provid开发者_StackOverflow社区e a fall back if the user/client does not have javascript.

How would I go about writing this type of fall back or does anyone have any working examples of a swfupload fall back?

Thanks in advance.


Seems the best approach is to use Flash detection as recommended by adobe here Adobe Flash Detection or this similar question on StackOverflow

Once the test is complete we could show / hide a div or input based on the results.

Something like this (jQuery / JS):

var swfu;

if (browserHasFlash() == false) {
   $("#flashUpload").hide();
   $("#regularUpload").show();
}
else {
    //Init SWF Upload
    swfu = new SWFUpload({
        upload_url : "http://www.swfupload.org/upload.php",
        flash_url : "http://www.swfupload.org/swfupload.swf",
        file_size_limit : "20 MB"
    });
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜