Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploadify in Chrome return Aw, Snap page

from last update of chrome (Version 36.0.1985.125 m) i have problem with uplodify plugin/flash. Chrome shows Aw, Snap Page or sometimes He's Dead, Jim!. Here is my uplodify code:

<input type="file" name="file_upload" id="file_upload_50">
<script type="text/javascript">
var basePath = "path to ressources";
var errorMessage = "Error Message";
var allowExts = "*.pdf; *.xls; *.xlsx; *.rar; *.zip";
$(document).ready(function() {
    var is_error = false;
    $('#file_upload_50').uploadify({
        'swf': basePath + '/uploadify/uploadify.swf',
        'uploader': "uploader.php",
        'height': 25,
        'buttonText': "Upload",
        'fileTypeExts': allowExts,
        'fileTypeDesc': "Formats:" + allowExts,
        'formData': {
            'user_id': 50,
            'company_id': 1
        },
        'onUploadError': function(file, errorCode, errorMsg, errorString) {
            alert(errorMessage);
            is_error = true;
        },
        'onUploadSuccess': function(file, data, response) {
            var result = $.parseJSON(data);
            if (!result.result) {
                alert(result.error_msg);
                is_error = true;
            }
        },
        'onQueueComplete': function(queueData) {
            if (!is_error) {
                document.location.href = "result_page.html";
            }
        }
    });
});
</script>

Where is the problem? Can you get me some advice. I am helpless. Thanks

like image 468
user3770756 Avatar asked Jul 25 '14 08:07

user3770756


People also ask

Why do I keep getting aw snap on Chrome?

This error code is shown in the Chrome aw snap page when Chrome runs out of available memory. Usually the cause is an application or website using too much memory. You can check via the task manager which applications use the most memory so you can close them.


2 Answers

I've found that adding a setTimeout fixes this. This would indicate a race condition in Chrome / Chrome's Flash implementation / Uploadify's Flash app, the circumstances of which are not clear. Nonetheless, it appears to work in all situations for our use case.

$(document).ready(function () {
    setTimeout(function () {
        $('foo').uploadify({...});
    }, 0);
});

This isn't a good answer, but in the absence of a solution, it's a usable workaround.

like image 105
mitchellrj Avatar answered Oct 15 '22 00:10

mitchellrj


It is due to cache most of the time.. try to change your Javascript include as below and error will be gone!.

<script type="text/javascript" src="<<path-to-uploadify>>/jquery.uploadify-3.1.js?ver=<?php echo rand(0,999999);?>"></script>
like image 35
karthik nataraj Avatar answered Oct 15 '22 00:10

karthik nataraj