dhtmlxVault uploadhandler get wrong form field on IIS7


I use dhtmlxVault on .NET platform. I call setFormfield in js file and then get form field value in uploadhandler.aspx, which worked rightly in development environment: windows XP and IIS 5.1.
But I deployed my web application into publish server: Windows 2008, .Net Framework 3.5 and IIS 7, the error happened.

In Js File, I set  a integer as form field and finally get  a value of null in uploadhandler.ashx

By the way, after the file uploading is completed, I use context.request.params[] to get the field.

The project is very urgent.

would you like give me some help or some soluion?

Thanks very much

You should read the value after file is processed in ashx handler. Otherwise there are no reasons for any error.
Besides, it is very difficult to tell anything reasonable without seeing the actual code.


Thank you very much for  answering my question timely.

 The  extracted code is as follows.      Please Inspect it and expect to get your adivce.
   /**********************************************JS Code**************************************************/

        this.vault = new dhtmlXVaultObject();
        this.vault.setServerHandlers("Vault/UploadHandler.ashx", "Vault/GetInfoHandler.ashx", "Vault/GetIdHandler.ashx");
         var fileType=["pdf","doc","docx","bmp","jpg","png"];
         ext = this.getFileExtension(fileName);
             alert("Only PDF、Word 、Picture File can uploaded!");
             return false;
          //****Controller is "this" object which create the Vault 
          Controller.Vault.setFormField("AccreditID", ProductMaster.AccreditID);
          Controller.Vault.setFormField("FileType", 8);

          return true;
    this.Vault.onFileUploaded = function(file)
         $("ReceivingFile").innerHTML='<a href="javascript: Controller.GetReceivingFile()" >{$FileName$}</a>'.replace("{$FileName$}",file.name.substring(file.name.lastIndexOf("\\")+1));

/**********************************************C# upload process Code**************************************************/
public void ProcessRequest(HttpContext context)

       //this is my added code line  
       if (!HttpContext.Current.User.Identity.IsAuthenticated) return;

        string fileRealName;
        string fileGuidName;

        string UploadFolder = context.Request.PhysicalApplicationPath + @"ChemicalAccreditFile\";

        if (context.Request.QueryString["sessionId"].ToString() != "")
            FileProcessor fp = new FileProcessor(UploadFolder);

            string extName = fileRealName.Substring(fileRealName.LastIndexOf('.') + 1);
            fileGuidName=fp.CurrentFileName = Guid.NewGuid().ToString() + "." + extName;

            HttpWorkerRequest workerRequest = (HttpWorkerRequest)context.GetType().GetProperty("WorkerRequest", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(context, null);
            if (workerRequest.HasEntityBody())
                    long contentLength = long.Parse((workerRequest.GetKnownRequestHeader(HttpWorkerRequest.HeaderContentLength)));
                    long CurrentBytesTransfered = 0;

                    // Read boundary marker from Content-Type header
                    bool BoundaryFound = false;
                    string ct = workerRequest.GetKnownRequestHeader(HttpWorkerRequest.HeaderContentType);
                    if (ct != null)
                        const string pattern = "boundary=";
                        int i = ct.IndexOf(pattern);
                        if (i > -1)
                            fp.Boundary = ct.Substring(i + pattern.Length);
                            BoundaryFound = true;
                            debug("boundary:" + fp.Boundary);
                    if (!BoundaryFound) throw new Exception("Multipart form boundary not found.");

                    // Try to read preloaded data. It is usually empty for Win2008 server
                    byte[] preloadedBufferData = workerRequest.GetPreloadedEntityBody();
                    if (preloadedBufferData != null)
                        CurrentBytesTransfered += preloadedBufferData.Length;
                        fp.ProcessBuffer(ref preloadedBufferData, true);
                        debug("preloaded:" + Convert.ToString(preloadedBufferData.Length) + "bytes");

                    // Read the rest of uploaded file
                    if (!workerRequest.IsEntireEntityBodyIsPreloaded())
                        byte[] bufferData = new byte[48 * 1024];
                            // Ask the worker request for the buffer chunk.
                            int rest = (int)Math.Min((long)bufferData.Length, contentLength - CurrentBytesTransfered);
                            long receivedCount = workerRequest.ReadEntityBody(bufferData, rest);
                            debug(Convert.ToString(receivedCount) + "bytes");

                            if (receivedCount > 0)
                                // Update the status object.
                                CurrentBytesTransfered += receivedCount;

                                // Save read data to the disk file
                                fp.ProcessBuffer(ref bufferData, true);

                                // Add the upload status to the application object. 
                                CurrentSize = Convert.ToString((CurrentBytesTransfered * 100 / contentLength));
                            // Clear array for new usage
                            Array.Clear(bufferData, 0, bufferData.Length);

                        } while (CurrentBytesTransfered < contentLength);
                catch (Exception ex)
                    CurrentSize = "-1";
                    CurrentSize = "-1";

                //******this is my code to record the uploaded file into databse. the result is: fileType is 0 and productID is 0;
                int fileType = Convert.ToInt32(context.Request.Form["FileType"]);
                int productID = Convert.ToInt32(context.Request.Form["AccreditID"]);
                ChemicalProcessManager.UpLoadFileForApplication(productID, fileType, fileRealName, fileGuidName);
        if (_debug != null) _debug.Close();

It looks okay, I have no idea why should it fail.


 My web applicaiton is published on a remote server, therefore I can't know more information about the server in detail.

 However, I insert alert function  in JS code and read text file in server code. By observing these output information, I confirmed there is a bug in DhtmlxVault On Window 2008.

 Now ,because of deadline, I can't do anything but look for other upload component.

 I wish the bug can be solved early.

It is possibly your Windows server settings issue as well. If you can provide me with access to the server and you have a valid license, i can spend some time to debug it. Win2008 server is very tricky to setup IIS, you can try it yourself.


Thank you very much!

The server is out of my controll. 

 I use dhtmlxVautl standard edition.

 Once  I have a chance to get more informaion about the remote server or the discussed problem, I will report it to you!

   Dhtmlx is my favorite ajax suite

Yes, it would be great to get access to the server.