Example #1
0
        public void Post(ImportBackup request)
        {
            AuthorizationInfo user_info = _ac.GetAuthorizationInfo(Request);
            UserPolicy        policy    = _userManager.GetUserPolicy(user_info.User);

            if (!policy.IsAdministrator)
            {
                return;
            }

            string headers = "";

            foreach (var head in Request.Headers.Keys)
            {
                headers += head + " : " + Request.Headers[head] + "\r\n";
            }
            _logger.Info("Header : " + headers);

            _logger.Info("Files Length : " + Request.Files.Length);

            _logger.Info("ContentType : " + Request.ContentType);

            Stream input_data = request.RequestStream;

            _logger.Info("Stream Info : " + input_data.CanRead);

            byte[] bytes = new byte[10000];
            int    read  = input_data.Read(bytes, 0, 10000);

            _logger.Info("Bytes Read : " + read);
            _logger.Info("Read : " + bytes);
        }
        public void Post(ImportBackup request)
        {
            string headers = "";

            foreach (var head in Request.Headers.Keys)
            {
                headers += head + " : " + Request.Headers[head] + "\r\n";
            }
            _logger.Info("Header : " + headers);

            _logger.Info("Files Length : " + Request.Files.Length);

            _logger.Info("ContentType : " + Request.ContentType);

            Stream input_data = request.RequestStream;

            _logger.Info("Stream Info : " + input_data.CanRead);

            byte[] bytes = new byte[10000];
            int    read  = input_data.Read(bytes, 0, 10000);

            _logger.Info("Bytes Read : " + read);
            _logger.Info("Read : " + bytes);
        }