Uploadify ruins file upload when no flash in browser

Nir O. picture Nir O. · Feb 28, 2011 · Viewed 16.3k times · Source

I have an HTML form with a file upload element, which is based on Uploadify. Unfortunately, if the browser doesn't have flash installed/enabled (I tested on Chrome and Safari), then the file upload element is completely disappearing, while I would have expected to have at least plain, regular, file upload html element as a fallback.

You can see this behavior even in Uploadify official demo (as of today, 28.2.2011):

http://www.uploadify.com/demos/

Anyone found his way around this? Cheers


none of these work in the situation that flash is installed, but is disabled !
for example, this line:

if (swfobject.getFlashPlayerVersion().major === 0)

behaves the same weather flash is installed and enabled, or installed and disabled !
I thought about obtaining uploadify API and checking it, but I have found zero examples, any ideas?

Answer

valmarv picture valmarv · Feb 15, 2012

I use the onSWFReady event, which isn't triggered if flash is disabled of course. I remove the block containing the native file input and show the uploadify div if swf is loaded, works like a charm:

onSWFReady: function() {
    $('#property-post .upload .browse').remove();
    $('#uploadify').css('display', 'block');
}