Search code examples
phpjqueryfirefoxcrashuploadify

uploadify firefox crash onsuccess response alert


i am implementing uploadify on my web to upload photos, and i trigger a response on success, everything is running well on chrome and IE 8, but firefox crashed every time the response alert pops up, nothing can be clicked, i cant even close the alert or the firefox, while firefox is still running on task manager's process, is it the code or is it my firefox ??

here's my uploadify code:

$('#file_upload').uploadify({
    'uploader'          : '/apaapaapa/clientside/js/uploadify/uploadify.swf',
    'script'            : '/apaapaapa/backend_admin/processes/anak.php',
    'cancelImg'         : '/apaapaapa/clientside/js/uploadify/cancel.png',
    'fileExt'           : '*.jpg;*.gif;*.png',
    'fileDesc'          : 'Web Image Files (.JPG, .GIF, .PNG)',
    'multi'             : true,
    'queueSizeLimit'    : 5,
    onAllComplete       : function(event, ID, fileObj, response, data){
                                $('#responseUploadify').html(response);

                            },
    onError             : function (event,ID,fileObj,errorObj) {
                                $('#responseUploadify').html(response);
                            }

});

and here's my upload code:

if(!empty($_FILES)) {
    $number         = implode(random_activation_code(3));   
    $path_parts     = pathinfo($_FILES['Filedata']['name']);
    $ext            = $path_parts['extension'];

    if($ext == 'jpeg' || $ext == 'jpg' || $ext == 'gif' || $ext == 'png'){
        $page = 'kids';

        $pic = new Gallery();       
        $pic->attach_file($_FILES['Filedata'], $page, $number);
        $pic->created       = time();

        if($pic->save()){
            echo "Success!";
        }else{
            echo "Failed";
        }
    }else{
        echo "Ooops.... extension error";
    }   
}

Solution

  • alert in the onComplete crash Firefox, it's normal... Display the response in a div.

    HTML :

    <div id="responseUploadify"></div>
    

    JS :

    onComplete          : function(event, ID, fileObj, response, data){
                                    $('#responseUploadify').html(response);
                                }
    

    Hope this help.

    PS: Sorry for my bad english ^^