This forum is a community forum meant for users of the plugin to collaborate and help solve issues with implementation, etc. Unfortunately, as the creator of the plugin, I do not have much time to attend to every request here as this is only a side project and I must work a full-time job to provide for my family. This is how I keep the Flash version free and the HTML5 version low cost.
UploadiFive 1.1.1 has been released which includes a small fix for added support on touch devices including iOS 6 devices.
How do I set fallback for IE and Safari with uploadifive?
  • Hi,

    I have uploadifive working with Firefox and Chrome. I am now wondering how to get the fallback working for IE and Safari. On your site it states "A fallback can be set for browsers that do not support the HTML5 File API", but I can't find any instructions as to how to set this fallback.

    I would be glad for some help with this.

    Thanks,

    Nick
  • Not Sure if this is the best way but this is what I did.
    you need to get modernizr plugin


    <form>
    <div id="queue"></div>
    <input id="file_upload" name="file_upload" type="file" multiple="true"/>
    <a id="uploadbutton" style="position: relative; top: 8px;" href="">Upload Files</a>
    </form>

    <script type="text/javascript">
    if (Modernizr.webworkers) {
    $(function () {

    $('#file_upload').uploadifive({
    'uploadScript': 'uploader.php',
    'auto': false,
    'formData': { 'test': 'something' },
    'queueID': 'queue',
    'method' : 'post'

    });
    });

    $('#uploadbutton').attr('href', "javascript:$('#file_upload').uploadifive('upload')");

    } else {
    $(function () {
    $('#file_upload').uploadify({
    'swf': '../../../../uploadify/uploadify.swf',
    'uploader': 'uploader.php',
    'auto': false,
    'formData': { 'test': 'something' },
    'queueID': 'queue'
    });
    });
    $('#uploadbutton').attr('href', "javascript:$('#file_upload').uploadify('upload')");
    }


  • Thanks.

    After a bit more searching I now realise that the onFallback function is what I was looking for. Including the uploadify script in this will do the trick.

    Nick
  • Hey nick, could you show me how you used the onFallback method? I'm trying to apply it as well
  • Here's what we did with more options specified:

    <script type="text/javascript">
    if(swfobject.hasFlashPlayerVersion("1"))
    {
    //flash
    $(function () {
    $("#file_uploader").uploadify({
    uploader: 'uploadify.swf',
    script: '#script_url#',
    scriptData: {#json_params#},
    folder: '/#folder_path#',
    method:'GET',
    fileDataName: 'file',
    buttonText: 'Upload File?',
    multi: false,
    removeCompleted: true,
    sizeLimit: 1024*1024*10, // 10mb
    fileExt: '#uploadify_allowed_file_extensions#',
    fileDesc: '#uploadify_allowed_file_extensions#',
    simUploadLimit: 1,
    cancelImg: 'cancel.png',
    auto: true,
    onError: function (a, b, c, d) {
    if (d.status == 404)
    alert("Could not find upload script. Use a path relative to: " + "<?= getcwd() ?>");
    else if (d.type === "HTTP")
    alert("error " + d.type + ": " + d.status);
    else if (d.type === "File Size")
    alert(c.name + " --> " + d.type + " Limit: " + Math.round(d.info / (1024 * 1024)) + "MB");
    else
    alert("error " + d.type + ": " + d.text);
    },
    onComplete: function (event, queueId, fileObj, response, data) {
    if (response.indexOf('display') > -1)
    $("##file_uploader_area .results").html(response);
    else
    location.href='#refresh_url#';
    }
    });
    });
    }
    else
    {
    //no flash
    $(function () {
    $("#file_uploader").uploadifive({
    uploadScript: '#script_url##url_params#',
    scriptData: {#json_params#},
    method:'POST',
    fileObjName: 'file',
    buttonText: 'Upload File?',
    multi: false,
    removeCompleted: true,
    sizeLimit: 1024*1024*10, // 10mb
    fileType: #uploadifive_allowed_mime_json#,
    simUploadLimit: 1,
    cancelImg: 'cancel.png',
    auto: true,
    onError: function (a, b, c, d) {
    if (d.status == 404)
    alert("Could not find upload script. Use a path relative to: " + "<?= getcwd() ?>");
    else if (d.type === "HTTP")
    alert("error " + d.type + ": " + d.status);
    else if (d.type === "File Size")
    alert(c.name + " --> " + d.type + " Limit: " + Math.round(d.info / (1024 * 1024)) + "MB");
    else
    alert("error " + d.type + ": " + d.text);
    },
    onUploadComplete: function (file, data) {
    if (data.indexOf('display') > -1)
    $("##file_uploader_area .results").html(data);
    else
    location.href='#refresh_url#';
    }
    });
    });
    }

    </script>

    <div id="file_uploader_area">
    <div class="results"></div><br>
    <input type="file" name="file_uploader" id="file_uploader" />
    </div><br>