title: Pluupload is very slow in server, In local host its very fast
body: <p>Pluupload is very slow in hosting server, In localhost its very fast
  In my localhost, when i try to upload 115MB, it's uploading in 30sec, when i try to host in the server, it's uploading same like normal asp.net file upload control performance.</p>
  
  <p>Is there any settings do i need to perform other than the below code. 
  It would be great if any one could suggested some thing</p>
  
  <p>Here is my code,</p>
  
  <pre><code>     $(document).ready(function () {
          $("#MainFileUpload").pluploadQueue({
              runtimes: 'html5,gears,flash,silverlight,html4',
              buttons: { browse: true, start: false, stop: false },
              url: 'TIABUploadHandler.ashx',
              max_file_size: '150mb',
              chunk_size: '2mb',
              multiple_queues: true,
              multipart: true,
              max_files: 1,
              flash_swf_url: '/js/plupload/plupload.flash.swf',
              silverlight_xap_url: '/js/plupload/plupload.silverlight.xap',
              filters: [
              { title: "Image files", extensions: "jpg,gif" },
              { title: "Zip files", extensions: "zip" },
              { title: "Document files", extensions: "doc,pdf,txt" }
              ],
              init: {
                  FilesAdded: function (up, files) {
                      var maxfiles = 1;
                      if (up.files.length &gt; maxfiles) {
                          up.splice(maxfiles);
                          alert('Only one file is allow to upload');
                      }
                      if (files.length &gt; 0) {
                          $.each(files, function (i, file) {
                              var parts = file.name.split('.')
                              var data = guid() + "." + parts[parts.length - 1];
                              $("#CurrentUploadedFileName").val(file.name);
                              $("#CurrentUploadedServerFileName").val(data);
                              $("#CurrentUploadedFileContentType").val(file.type);
  
                          });
                      }
                      if (up.files.length === maxfiles) {
                          $('#MainFileUpload_browse').hide("slow"); // provided there is only one #uploader_browse on page
                      }
                  },
                  FilesRemoved: function (up, file) {
                      if (up.files.length === 0) {
                          $('#MainFileUpload_browse').show("slow");
                      }
                      else {
                          $('#MainFileUpload_browse').hide("slow");
                      }
                  },
                  BeforeUpload: function (up, file) {
                      uploader.settings.multipart_params = { fileId: $("#CurrentUploadedServerFileName").val() };
                  }
              }
          });
  
          var uploader = $('#MainFileUpload').pluploadQueue();
  function guid() {
              function _p8(s) {
                  var p = (Math.random().toString(16) + "000000000").substr(2, 8);
                  return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p;
              }
              return _p8() + _p8(true) + _p8(true) + _p8();
          }
  </code></pre>
  
  <p>Here is my Handler Code </p>
  
  <pre><code>      Dim chunk As Integer = If(context.Request("chunk") IsNot Nothing, Integer.Parse(context.Request("chunk")), 0)
      Dim chunks As Integer = If(context.Request("chunks") IsNot Nothing, Integer.Parse(context.Request("chunks")) - 1, 0)
  
      Dim fileName As String = If(context.Request("fileId") IsNot Nothing, context.Request("fileId"), String.Empty)
  
      Dim fileUpload As HttpPostedFile = context.Request.Files(0)
  
      Dim uploadPath = context.Server.MapPath("~/App_Data/")
      Using fs = New FileStream(Path.Combine(uploadPath, fileName), If(chunk = 0, FileMode.Create, FileMode.Append))
          Dim buffer = New Byte(fileUpload.InputStream.Length - 1) {}
          fileUpload.InputStream.Read(buffer, 0, buffer.Length)
  
          fs.Write(buffer, 0, buffer.Length)
      End Using
  
      context.Response.ContentType = "text/plain"
      context.Response.Write(fileName)
  </code></pre>