strange dhtmlxVault problem when I get form field

Hello,

   I use dhtmlxVault in  C#  asp.net  enviroment on windows XP.  I call setFormField to transfer data for using in uploadhandler.ashx. I use Request.Form to get form field.
  
   In this way, when the uploaded file size is less than 48k, it works rightly. But if the uploaded file size is bigger than 48k, it only transfer 48k content to server and the loading icon is always displaying.

    can anyone please help me with a solution? 

    Thank you!

/********************* my example code as follows:************************************/

   vault = new dhtmlXVaultObject();
        vault.setImagePath("codebase/imgs/");
        vault.setServerHandlers("Vault/UploadHandler.ashx", "Vault/GetInfoHandler.ashx", "Vault/GetIdHandler.ashx");
        //vault.setFilesLimit(1);
        vault.onAddFile=function(fileName) 
        {
           if(vault.getFilesCount()>=1)   vault.removeAllItems();
           
            vault.setFormField("ProductID", "1");
            vault.setFormField("FileType", "2");
           
           return true;
        };

//************** In uploadhander.ashx*********
if (context.Request.QueryString[“sessionId”].ToString() != “”)
{
//***** Only this line is my code.If I delete this code line, the vault works rightly
string productID = context.Request.Form[“ProductID”];

        FileProcessor fp = new FileProcessor(UploadFolder);
        
        fp.CurrentFileName =context.Request.QueryString["fileName"];

As from the doc, you should first call vault.create(…) and afterwards vault.setFormField(…).
Actually I can not find the create in your code?

I’ve had the same problem man!!! Please post ur solution if u get one.

This is my Vault creation code and I have the same problems as mentioned…

var vault = new dhtmlXVaultObject();

function createVault(reid, type, locumId) {
vault.setImagePath("…/codebase/dhtmlxvault/codebase/imgs/");
vault.setServerHandlers("…/codebase/dhtmlxvault/handlers/aspx/UploadHandler.ashx",
“…/codebase/dhtmlxvault/handlers/aspx/GetInfoHandler.ashx”,
“…/codebase/dhtmlxvault/handlers/aspx/GetIdHandler.ashx”);
vault.create(“vaultDiv”);
vault.setFormField(“picsPath”, reid + “\” + type + “\” + locumId);
}

Function createVault is called from the body’s onload property defined function and passes “reid”, “type” and “locumId” which are strings.

Where in your code you do it? It may break the file transfer. Please provide me your server-side handler.

Here is his server-side handler code.

//************** In uploadhander.ashx*********
if (context.Request.QueryString[“sessionId”].ToString() != “”)
{
//***** Only this line is my code.If I delete this code line, the vault works rightly
string productID = context.Request.Form[“ProductID”];

FileProcessor fp = new FileProcessor(UploadFolder);

fp.CurrentFileName =context.Request.QueryString[“fileName”];

yes, you cannot refer to Form before the file is processed. Do it afterward.

Hello,
In my case, I’m using that form field to give an upload path to the uploadHandler, because I need to have the uploaded files grouped in different folders. So I get the context.Request.Form[“ProductID”] before processing the file because fileProcessor object is created with the filePath parameter. After that, the fileProcessor.processBuffer method is called, and this method start writting the file in the given filePath. I tried getting the path before the processBuffer method is called but the problem continues.

So, I decide to create a class that handles the path as a static attribute, I think this should work but, do u have a way of giving vault that property?? I mean that vault could easily handle the path where it is needed to put the files uploaded.

All my greetings!!!

Ok, almost solved, but now I have problems uploading 2 or more files simultaneously. Sometimes the upload process gets stuck.

I thought that the problems were the spaces in the file name but I handled it and it wasn’t fix.

The idea is that FileProcessor should at first receive the file, then you can use Form fields for whatever and even move the file to the right folder. Multiple files are processed one by one, so it should not be any difference. Please check your code - it should provide correct information back to the client (no exceptions etc.) so that the multiple file process can move smoothly.