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.
The infamouse 2038 error
  • Hi guys,

    I know this error has been discussed so many times but it seems that one really has a full answer. I like many have spent many hours trying to debug this bugger with no success. My results so far is odd at best.

    I have added debug code that would alert in javascript and server to email me the error from the uploader script.
    For me the error seems to happen mostly on windows (win 7) using ie8.
    So for windows I get the javascript alert window "error IO: Error #2038" and no email. This made me think that it might be a bad internet connection? I will answer this one soon.
    On my mac using safari 4 I don't get any error, no email no javascript alert. The progress bar simple stalls and the upload never completes. On my mac I can tell from the network traffic that the upload is not longer going.
    I have even installed wireshark to see if the network drops out but it doesn't seem to be the case.

    I have also changed my local network to try and prove some faults. My network works like this. My mac hooks up wirelessly to the internet through my router. Then I have a lan cable from my mac to my window system. Obversely I then share my mac's internet connection to my pc. So mac is wireless and the pc cable to the mac so the only real connection is the wireless one.

    Then I upload from both system mac and pc at same time. Mostly on the pc fails as per the error above and sometimes the mac. My thoughts are that if it's the internet/wireless connection then both should fail at the same time but they don't. This then makes me think it the server but then again why does the pc fail more than the mac?

    I do not run security_mod (or rather it's not in the httpd.conf file)
    My time out, post and upload limits are more than big enough.
    I have check my server logs, I can't find any faults in there.

    A little more about the failures.
    I have successfully uploaded file that's 800mb in size. I have had failures with large file and smaller ones. The way I have the windows system fail the most is to upload images that's 3 to 6 mb in size and uploading 2 at a time.

    At this stage I am thinking it's an inherent problem in flash? Perhaps it's best to just take my losses and do a php apc solution.

    I am including my javascript and php code. Any help would greatly appreciated (I am even willing to pay for a developer to resolve this error)

    Javascript:

    $(document).ready(function() {
    $(\"#uploadify\").uploadify({
    'uploader' : 'jscripts/uploadify/uploadify.swf',
    'script' : 'includes/fileUploader2.php',
    'checkScript' : 'includes/checkFiles.php?s=<?=base64_encode($s)?>',
    'cancelImg' : 'jscripts/uploadify/cancel.png',
    'folder' : '',
    'fileDesc' : 'Select Files',
    'fileExt' : '<? if(!empty($rwE['fileExt'])){
    foreach($exts as $value){
    echo \"*\".$value.\";\";
    }
    }else{
    echo \".\";
    }?>',
    'buttonText' : 'Select Files',
    'scriptData' : {'subCompId':'<?=base64_encode($s)?>', 'compID':'<?=$_SESSION['ql_compID']?>'},
    'queueID' : 'fileQueue',
    'auto' : true,
    'multi' : true,
    'sizeLimit' : '1038860800',
    'simUploadLimit': '2',
    'onComplete' : function(event, queueID, fileObj, response, data){
    if(response != '1'){
    $('<div>'+fileObj.name+ 'Upload failed! '+response+'</div>').appendTo('#upErrors').addClass('alert');
    }
    else{
    $('<div>'+fileObj.name+' Upload successful</div>').appendTo('#upErrors').addClass('greenOk');
    }
    },
    '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.info);
    else if (d.type ===\"File Size\")
    alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB');
    else
    alert('error '+d.type+\": \"+d.info);
    }

    });
    });

    php:

    <?
    require_once(\"conn.php\");
    /*** Protect Variables from SQL injection ***/
    function cv($value){
    // Stripslashes
    if (get_magic_quotes_gpc()){
    $value = stripslashes($value);
    }
    // Quote if not a number
    if (!is_numeric($value)){
    $value = \"'\" . mysql_real_escape_string($value) . \"'\";
    }
    return $value;
    }
    /*** format the stoage number ie kb mb ***/
    function theSize($size){
    $setTxt = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
    $e = floor(log($size)/log(1024));
    $output = @sprintf('%.2f '.$setTxt[$e], ($size/pow(1024, floor($e))));
    return $output;
    }
    /*** Get relevant company details ***/
    function compInf($id,$col){
    $rs = mysql_query(\"SELECT \".$col.\" FROM comp WHERE compID = \".cv($id).\" LIMIT 1\");
    $rw = mysql_fetch_assoc($rs);
    return $rw[$col];
    mysql_free_result($rs);
    }
    /*** See if master comp is an sub of comp being uploaded to ***/
    function scomp($theCompID,$theSubCompID){
    $rs = mysql_query(\"SELECT * FROM compRel WHERE compId = \".cv($theCompID).\" AND subCompId = \".cv($theSubCompID).\" AND apprv = '1' \");
    if(mysql_num_rows($rs)){
    return true;
    }else{
    return false;
    }
    mysql_free_result($rs);
    }
    /*** Set decoded variable ***/
    $sCompID = base64_decode($_POST['subCompId']);

    if (!empty($_FILES)) {
    /*** Get file information ***/
    $tempFile = $_FILES['Filedata']['tmp_name'];//temp file name
    $targetPath = '../ql_uploads/'.compInf($sCompID,'compFolder').'/';//path to company folder being uploaded to
    $ext = pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION);//get extention of file
    $ext = strtolower($ext);//make extention lower case to allow uppercase uploades

    /*** Create unidue file name ***/
    $fileName = uniqid(\"\").\".\".$ext;
    $targetFile = str_replace('//','/',$targetPath) . $fileName;//attach filename to relevant path

    /*** Check that the file ext is approved ***/
    $fileTypes = str_replace('*.','',$_REQUEST['fileext']);
    $fileTypes = str_replace(';','|',$fileTypes);
    $typesArray = split('\|',$fileTypes);
    $fileParts = pathinfo($_FILES['Filedata']['name']);


    /*** Move uploaded file and write to DB ***/
    if(move_uploaded_file($tempFile,$targetFile)){
    $up = \"INSERT INTO files VALUES ('',\".cv($fileName).\",\".cv($_FILES['Filedata']['name']).\",\".cv($_FILES[\"Filedata\"][\"size\"]).\",NOW(),'',\".cv($sCompID).\",\".cv(compInf($sCompID,'compName')).\",\".cv($_POST['compID']).\",\".cv(compInf($_POST['compID'],'compName')).\")\";
    $rsU = mysql_query($up,$admin);
    }
    }
    /*** Some Error checking ***/
    switch ($_FILES['Filedata']['error']){
    case 0:
    // $msg = \"No Error\"; // comment this out if you don't want a message to appear on success.
    break;
    case 1:
    $msg = \"The file is bigger than this PHP installation allows\";
    break;
    case 2:
    $msg = \"The file is bigger than this form allows\";
    break;
    case 3:
    $msg = \"Only part of the file was uploaded\";
    break;
    case 4:
    $msg = \"No file was uploaded\";
    break;
    case 6:
    $msg = \"Missing a temporary folder\";
    break;
    case 7:
    $msg = \"Failed to write file to disk\";
    break;
    case 8:
    $msg = \"File upload stopped by extension\";
    break;
    default:
    $msg = \"unknown error \".$_FILES['Filedata']['error'];
    break;
    }

    if($msg){
    $stringData = \"Error: \".$_FILES['Filedata']['error'].\" Error Info: \".$msg;
    mail(\"[email protected]\",\"Upload debug\",$stringData);
    }else{
    $stringData = \"1\"; // This is required for onComplete to fire on Mac OSX
    echo $stringData;
    }


    ?>
  • It's unfortunate, but as you've found error #2038 is a general error that flash throws when it can't find anywhere else to put it's error.

    Off the top of my head I would try

    [list]Try a straight upload script without all the extra functions and processing
    To test if it's your server/network install XAMPP on a local machine and try your web pages/scripts locally[/list:u]
  • Hi Travis,

    Thanks for getting back to me. I first developed the system locally and works flawless. It only happens on the web. I know my code includes some procedural functions but commenting them out makes no difference.

    Can you think of anything else that I could add in flash, javascript or php to debug this? I can give you access to the system if you wish but not will to post a username and password here :) .
  • TravisN. said:
    It's unfortunate, but as you've found error #2038 is a general error that flash throws when it can't find anywhere else to put it's error.

    Off the top of my head I would try

    [list]Try a straight upload script without all the extra functions and processing
    To test if it's your server/network install XAMPP on a local machine and try your web pages/scripts locally[/list:u]

    I completely scaled back my code to minimum and still get the error?

    <?
    require_once(\"conn.php\");
    /*** Set decoded variable ***/
    $sCompID = base64_decode($_POST['subCompId']);

    if (!empty($_FILES)) {
    /*** Get file information ***/
    $tempFile = $_FILES['Filedata']['tmp_name'];//temp file name
    $targetPath = '../ql_uploads/Har4b69d8c74d949/';//path to company folder being uploaded to
    $ext = pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION);//get extention of file
    $ext = strtolower($ext);//make extention lower case to allow uppercase uploades

    /*** Create unidue file name ***/
    $fileName = uniqid(\"\").\".\".$ext;
    $targetFile = str_replace('//','/',$targetPath) . $fileName;//attach filename to relevant path


    if(move_uploaded_file($tempFile,$targetFile)){


    }

    }
    /*** Some Error checking ***/
    switch ($_FILES['Filedata']['error']){
    case 0:
    // $msg = \"No Error\"; // comment this out if you don't want a message to appear on success.
    break;
    case 1:
    $msg = \"The file is bigger than this PHP installation allows\";
    break;
    case 2:
    $msg = \"The file is bigger than this form allows\";
    break;
    case 3:
    $msg = \"Only part of the file was uploaded\";
    break;
    case 4:
    $msg = \"No file was uploaded\";
    break;
    case 6:
    $msg = \"Missing a temporary folder\";
    break;
    case 7:
    $msg = \"Failed to write file to disk\";
    break;
    case 8:
    $msg = \"File upload stopped by extension\";
    break;
    default:
    $msg = \"unknown error \".$_FILES['Filedata']['error'];
    break;
    }

    if($msg){
    $stringData = \"Error: \".$_FILES['Filedata']['error'].\" Error Info: \".$msg;
    mail(\"[email protected]\",\"Quickload debug\",$stringData);
    }else{
    $stringData = \"1\"; // This is required for onComplete to fire on Mac OSX
    echo $stringData;
    }

    ?>
  • This error is driving my insane! I have now installed flash player debugger and still not real headway is made. I code has completely been scaled back. I can now get the system to fail every time(just about) with 20 files (3 - 6 mb) to upload at least 3 or 4 will fail with IO #2032. The odd thing is it's IE failure only. Firefox does not fail. This boggles my mind. After reading most of flash errors documentation the only reason why I can be getting this error is "An input/output error occurs while the player is reading, writing, or transmitting the file" which one ...... I don't know. Does anyone know how I could debug this part to figure out which it is and why it only IE that fails. I have tested this on multiple computers and yes mostly IE fails.
  • I have resolved the problem for anyone who is interested. I decided to give another uploader ago to see if I get the same problems. I installed swfuploader and seems to work perfectly. I am not sure way I kept on get the error in uploadify and way I do not get it with swfuploader.