English 中文(简体)
脱节XML时扼杀基64的无效特征
原标题:Invalid Character in base64 string when decoding XML

我们有一份Winform客户数据,即我们撰写的网络服务。 该客户提供XML档案中的文件,一般是一份PDF文件,在XML档案中写到64个编码的双手领域。

客户成功地下载、编码和正确开出99%的文件。

然而,当客户发出这一呼吁时,我们开始碰到一些失败的档案:

 byte[] buffer = Convert.FromBase64String(xNode["fileIMAGE"].InnerText);

系统。

Message="Invalid character in a Base-64 string."
Source="mscorlib"

We ve written out the base64 blob from the XML file to a text file. I don t see any "" characters. I could post the whole blob, but it s quite large.

任何想法?

最佳回答

Issue Resolved

为了将档案从服务器上流出,我们利用反馈功能阅读/填写档案。 我们是每座nk64的基底。 EPAONG。

第-号决议 向全球记忆流标出的所有空白。 在呼吁结束时,第64号基则正在编码。

In the callback function:

 if (brData.ChunkNo == 1)
    {

        // Set the Content-type of the file
        if (brData.MimeType.Length < 1)
        {
            mimeType = "application/unknown";
        }
        else
        {
            mimeType = brData.MimeType;
        }

        msbase64Out = new MemoryStream();
    }


    if (brData.bytesJustRead > 0)
    {
        fileMS.WriteTo(msbase64Out);

    }


   if (brData.bytesRemaining < 1)
    {
        byte[] imgBytes = msbase64Out.ToArray();

        string img64 = Convert.ToBase64String(imgBytes);

        viewdocWriter.WriteString(img64);
    }

msbase64Out is a global memory stream that gets written to each time the callback is called. viewdocWriter is a global XML writer that is responsible for writing out the XML stream that gets sent to the client app.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签