public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
    {

        TransportClassMainAshx oTransportClassMainAshx = new TransportClassMainAshx(context, cb);
        ErrorTypes eError = ErrorTypes.NoError;
        try
        {
            _log.Info("Starting process request...");
            _log.Info(context.Request.QueryString.ToString());

            string sGuid = context.Request.QueryString["key"];
            int nMaxBytes = Convert.ToInt32(ConfigurationSettings.AppSettings["limits.image.size"] ?? "25000000");
            if (context.Request.ContentLength <= nMaxBytes)
            {
                if (context.Request.Files.Count > 0)
                {
                    
                    int nParamsCount = 0;
                    string sInputParams = "";
                    for (int i = 0, length = context.Request.QueryString.Count; i < length; ++i)
                    {
                        sInputParams += context.Request.QueryString.Get(i) + ":" + context.Request.QueryString.GetKey(i);
                        if (nParamsCount > 0)
                            sInputParams += ",";
                        nParamsCount++;
                    }
                    AsyncMediaXmlOperation oAsyncMediaXmlOperation = new AsyncMediaXmlOperation();
                    List<string> aUrls = new List<string>();
                    TransportClass1 oTransportClass1 = new TransportClass1(oTransportClassMainAshx, oAsyncMediaXmlOperation, context.Request.QueryString, aUrls, sGuid, Path.Combine(sGuid, @"media/media.xml"), context.Request.Files, context.Request.Files.GetEnumerator());
                    oAsyncMediaXmlOperation.GetMediaXmlBegin(oTransportClass1.m_sMediaXml, GetMediaXmlCallback, oTransportClass1);
                }
                else
                    eError = ErrorTypes.UploadCountFiles;
            }
            else
                eError = ErrorTypes.UploadContentLength;
        }
        catch(Exception e)
        {
            eError = ErrorTypes.Upload;
            
            _log.Error(context.Request.QueryString.ToString());
            _log.Error("Exeption: ", e);
        }
        if (ErrorTypes.NoError != eError)
            WriteToResponse(oTransportClassMainAshx, eError, null, context.Request.QueryString);
        return new AsyncOperationData(extraData);
    }
 private void ImageUrlCommand(TransportClassContextRead oTransportClassContextRead, InputCommand cmd)
 {
     AsyncMediaXmlOperation oAsyncMediaXmlOperation = new AsyncMediaXmlOperation();
     TransportClassMediaXml oTransportClassMediaXml = new TransportClassMediaXml(oTransportClassContextRead, cmd, oAsyncMediaXmlOperation, null);
     oAsyncMediaXmlOperation.GetMediaXmlBegin(Path.Combine(cmd.id, "media/media.xml"), GetMediaXmlCallback, oTransportClassMediaXml);
 }