Error 2038 on large upload

Last post 06-15-2011, 9:57 PM by Kenneth. 7 replies.
Sort Posts: Previous Next
  •  06-13-2011, 1:14 PM 67929

    Error 2038 on large upload

    Hi,
     
    We have setup a site to use your PHPFileUploader and are in the process of testing it. The site is predomintly written in PHP and is running on a Windows 2008 Server in IIS7. Both IIS and the PHP settings have been modified to accept large file uploads of 2GB.
     
    The PHPFileUpload script is being used in two places, one for single uploads and the other for multiple file uploads. Both scripts have the
    MaxSizeKB set to 2048000.
     
    What we are finding in testing, is that in Firefox and Safari so far, if the file exceeds 2GB (We have been testing with file sizes of 4 and 5GB), instead of getting a friendly error message to say the upload size has been exceeded we are getting a dialog that says:
     
    prepairitem:0 error:
    Error #2038 at null
     
    Uploading files just under 2GB are working fine. Can someone please advise? Thanks in advance.
  •  06-13-2011, 2:58 PM 67930 in reply to 67929

    Re: Error 2038 on large upload

    Dear greggs,
     
    PHP File Uploader is designed to work with up to 2GB files. The reason for the limit is simple - current browsers does not support upload of bigger files than 2GB over internet and IIS also accepts only 2GB files.
     
    Please refer to the following code and set the MaxSizeKB to 2G:
     
    <?php
       $uploader=new PhpUploader();
       
       $uploader->MultipleFilesUpload=true;
       $uploader->InsertText="Upload (Max 2G)";
       
       $uploader->MaxSizeKB=2048000; 
       
       $uploader->Render();
      ?> 
     
    Thanks for asking
  •  06-13-2011, 3:14 PM 67932 in reply to 67930

    Re: Error 2038 on large upload

    Hi Eric,
     
    Thanks for your response. Sorry, I should have made it clear, that we don't want people uploading more than 2GB, so that part is fine. We just want a friendly error message if someone does upload more than that. Also, is 2048000 not 2GB in KB?
     
    Thanks.
  •  06-13-2011, 4:54 PM 67937 in reply to 67932

    Re: Error 2038 on large upload

    Hi greggs,
     
    You can also try the following code, if you choose files more than 2G, it will display friendly message:
    <?php require_once "phpuploader/include_phpuploader.php" ?>
    <?php session_start(); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
     <title>Demo 2 - use UploadUrl property</title>
    </head>
    <body>
     <?php
       $uploader=new PhpUploader();
       $uploader->MultipleFilesUpload=true;
       $uploader->InsertText="Upload (Max 2G)";
       $uploader->MaxSizeKB=2048000;
       //2048000KB=2048M=2G
       $uploader->Render();
     ?>
     
     <script type='text/javascript'>
     function CuteWebUI_AjaxUploader_OnTaskComplete(task)
     {
      var div=document.createElement("DIV");
      var link=document.createElement("A");
      link.setAttribute("href","savefiles/myprefix_"+task.FileName);
      link.innerHTML="You have uploaded file : savefiles/myprefix_"+task.FileName;
      link.target="_blank";
      div.appendChild(link);
      document.body.appendChild(div);
     }
     function CuteWebUI_AjaxUploader_OnSelect(files) {  
            var selectedSize = 0;
            for (var i = 0; i < files.length; i++) {          
              if(files[i].FileSize>2*1024*1024*1024)
              {
                  alert("File size is limited to 2G");
                  return false;
              }
            }
        }
     </script>
     </body> 
    </html>
     
    Thanks for asking
  •  06-13-2011, 5:09 PM 67938 in reply to 67937

    Re: Error 2038 on large upload

    Hi Eric,
     
    I made the change you suggested and tested it on something smaller, by having the alert fire on 2*1024*1024 (200mb), which it did successfully.
     
    However when I up it to 2GB using the code 2*1024*1024*1024 and once again try upload the 5GB file, I get my original error message 2038. The friendly message does not fire.
  •  06-13-2011, 6:30 PM 67939 in reply to 67938

    Re: Error 2038 on large upload

    Hi Eric,
     
    Just to add. This problem doesn't seem to be happening on all machines. On a windows machine (running windows 7), we are getting the normal error using the oversized file, and if I remove your script, I get the original PHPFileUpload oversized friendly error message. This is in IE, FF, Chrome and Opera.
     
    So far this problem then seems to be limited to OSX and Safari/FF. I will try some other browser types on the Mac tomorrow.
     
    Thanks.
  •  06-14-2011, 1:27 PM 67959 in reply to 67939

    Re: Error 2038 on large upload

    Hi Eric,
     
    Some more info to the problem. We have tried testing on an older machine running Windows XP & IE 8, and we are getting a similar error upon uploading smaller files (200mb). The error is similar to what I see on your support boards for the AJAX Uploader:
      
    Flash: the upload task is interrupted! io Error #2038
     
    The difference between the two errors we are receiving, is that the first happens straight away upon selection of the files, whereas this second version is happening during the upload.
     
    I have checked and our web.config file for this site has already been increased to accommodate the larger uploads, so I don't believe it's a problem there:
     
    <requestLimits maxAllowedContentLength="2147483647" /> 
     
    Thanks for your help.
  •  06-15-2011, 9:57 PM 67983 in reply to 67959

    Re: Error 2038 on large upload

    Hi greggs,
     
    The example below shows you how to catch the upload error message and show your custom message.
     
    <?php require_once "phpuploader/include_phpuploader.php" ?>
    <?php session_start(); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>example</title>

    </head>
    <body>
        <div>
               <?php
                $uploader=new PhpUploader();
                $uploader->MultipleFilesUpload=true;
                $uploader->InsertText="Upload Multiple File (Max 10M)";
                $uploader->MaxSizeKB=102400;    
                $uploader->AllowedFileExtensions="jpeg,jpg,gif,png,zip,mpg";
                $uploader->Render();
            ?>    
            
    <script>
     function CuteWebUI_AjaxUploader_OnError(msg)
        {
            if(msg.indexOf("2038")!=-1)
            {
            //show the message you want
                alert("The file is locked");
                return false;
            }
        }
        </script>        
        </div>
    </body>
    </html>
     
    Regards,
     
    Ken
View as RSS news feed in XML