|115460||Jan 17,2014 03:38 PM UTC||Jan 21,2014 12:17 PM UTC||Silverlight||3|
Thank you for your interest in Syncfusion products.
When the code “DocxExporting.ConvertToDocument(wordDoc.Document, stream, "." + extension);” gets executed, the file pointer is moved to the end of file location. So while trying to read the stream data it starts reading from end of file location. So only you are unable to read the stream and get the value 0.
To overcome this problem just set stream position to 0 using the code, “stream.Position = 0”. Here is the modified code snippet.
while (numBytesToRead > 0)
stream.Position = 0;
// Read may return anything from 0 to numBytesToRead.
int n = stream.Read(App.FilesToUpload.File, numBytesRead, numBytesToRead);
//Your remaining code
For your reference, we have prepared a sample to illustrate the same. Please find the attached sample and let us know if this helps you.
Please let us know if you need any further assistance.
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.
This page will automatically be redirected to the sign-in page in 10 seconds.