We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

junk characters as string while reading from streamreader

Thread ID:

Created:

Updated:

Platform:

Replies:

128165 Jan 5,2017 07:12 PM UTC Jan 6,2017 01:36 PM UTC ASP.NET Web Forms 1
loading
Tags: DocIO
Anandi
Asked On January 5, 2017 07:12 PM UTC

Hi  all,
I am not able to download the file using chrome (notwork error). I understand it can happen due to security settings in chrome. So, I am saving the file  to database and retrieving from the DB. But  when saving the created document to memorystream and then reading from it, I see a bunch of junk characters.

here are the stops:
1. create document object through createdoc method.
2. Load it into memorystream:

Dim stream As New System.IO.MemoryStream()

objWordDocument.Save(stream, Syncfusion.DocIO.FormatType.Docx)


3.get the binary data :

        Dim b() As Byte
        Using br As New System.IO.BinaryReader(stream)
            b = br.ReadBytes(stream.Length)
        End Using

save into database and retrieve it. But it has junk characters. Please help.

          Dim Response As System.Web.HttpResponse = System.Web.HttpContext.Current.Response
            Response.ClearContent()

            Response.ContentType = "application/Doc"
            Response.BinaryWrite(attachmentInfo)


This one has the junk characters.

Thanks a lot.

Anandi





End Using


How can I


Vijay Ramachandran [Syncfusion]
Replied On January 6, 2017 01:36 PM UTC

Hi Anandi,

Thank you for contacting Syncfusion support.

We are unable to reproduce the mentioned issue with the given details. Please find the sample which we have used at our end to test the given scenario.
http://www.syncfusion.com/downloads/support/forum/128165/ze/GenerateWord-DocIOApplication1546926520.zip

In that sample we have done the following things:
   1. Created Word document and saved as a memory stream using DocIO.
   2. Inserted that memory stream as byte array into the Data base.
   3. Retrieved the binary data from the database and it downloaded as a Word document in a web browser.

Kindly use the above sample to meet your requirement, if you are still facing the issue then kindly provide us your sample or modify the above sample along with the following details.
   1. Provide the input Word document and Data base details which you are used in your sample
   2. Provide screen shots of your current output (highlight the junk characters) and expected output.

So, that we can analyze further and provide you the possible solutions as much early as possible


Let us know if you have any concern.

Regards,
Vijay R
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;