Convert blob, doc to docx

I am able to get the doc files from data that I want to resave as docx. I have a procedure that I send a file id and returns memorystream, I then was trying to save to file on my desktop to visual see that it saved as a docx. I would normally update the database with the newly converted doc. Suggestions please on how I should do this? Examples?

@mclinton You can load document from stream and save it to stream. For example see the following code:

byte[] srcBytes = File.ReadAllBytes(@"C:\Temp\in.doc");

using (MemoryStream srcStream = new MemoryStream(srcBytes))
{
    // Load document
    Document doc = new Document(srcStream);
    // Save document into another stream
    using (MemoryStream dstStream = new MemoryStream())
    {
        doc.Save(dstStream, SaveFormat.Docx);
        // Get byte array of the output document.
        byte[] dstBytes = dstStream.ToArray();
    }
}

Please see our documentation to learn more about loading and saving document to external source:
https://docs.aspose.com/words/net/serialize-and-work-with-a-document-in-a-database/

So, before doc.Save, my srcBytes byte[30720], but when I do the doc.save(dstStream, SaveFormat.Docx); The byte[] dstBytes bytes[10247] and when I have to database, I get a 0x50 stored in database.

@mclinton DOC and DOCX formats have different formats and compression, so output file size might differ - this is expected.

But the file is now corrupt in the database… 0x50 is what I see in the database.

@mclinton I d not think the problem is related to Aspose.Words. Most likely the output document bytes are improperly written into data base or improperly read from it. For testing purposes, you can save the output document to file to make sure the document produced by Aspose.Words is valid, then read the file bytes and write it to data base, then check whether the file read from data base is valid.