• 10
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

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

      • 1
    • I have never used Uploadify, but just wondering: Why do you even need Flash for that in Chrome? Isn't it supposed to fall back to Flash only when HTML5 File API is not available?
    • I have the exact same issue with the exact same version of Chrome. My website uses uploadify as well. I've recently been getting Aw Snap on Chrome quite often. I'd think this probably has something to do with Chrome or Flash's latest update.

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.

  • 15
Reply Report

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>
  • 2
Reply Report
      • 1
    • it fixed the Aw, Snap page~ but can u explain how this worked ? because when put this code on the page , the page will load very slow

If this is your current code - shouldn't the 'basePath' be a relative/direct url ?

So, instead of

var basePath = "path to ressources";

Shouldn't it be more like

var basePath = "/assets/RESOURCE_FOLDERNAME";

or an empty string ?

  • -1
Reply Report
    • I'm not sure if this helps you - but try debugging the upload process using chrome Inspector, and the Network tab. You should be able to see your requests and their server status (like 500, or 200). This might help you narrow down the main issue, as it seems to me, that there is something bad "under the hood"
      • 1
    • The same thing has started happening to me as well. Everything was fine, now I get the 'Aw Snap' page every time, ever since updating Chrome to the latest version. It works fine in IE and it even works if I simply refresh the page so I have no idea what's going on.

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions