Loading a docx into RadRichTextBox from a remote server

3 posts, 0 answers
  1. Mel
    Mel avatar
    5 posts
    Member since:
    Nov 2011

    Posted 17 Nov 2011 Link to this post

    I have the handle to a URL stream  -
    Uri(file.URI + "?render=stream"UriKind.Absolute);
    where the file.URI is the file's complete URL and the render on the server is a php function that will send the file over as a stream.
    How do I use this to load directly into a RadRichTextBox?
  2. Dave Navarro
    Dave Navarro avatar
    150 posts
    Member since:
    Jul 2005

    Posted 18 Nov 2011 Link to this post


    I need to load a .docx file from a server too but without the php function on the backend. I've read through a lot of the help docs but haven't figured it out yet.

    If you should find a solution would you please post it here? I'll do the same!

    Many thanks in advance,

    ~ Dave
  3. DevCraft banner
  4. Iva Toteva
    Iva Toteva avatar
    1319 posts

    Posted 22 Nov 2011 Link to this post

    Hi Mel,

    As long as you can obtain a stream with the content of the file in a specific format, you can load it in the rich text box in the following way:

    IDocumentFormatProvider formatProvider = DocumentFormatProvidersManager.GetProviderByExtension(".docx");
    this.editor.Document = formatProvider.Import(stream);

    You can find more information on the format providers in this article.

    Please refer to this forum thread for a demo project showing how a file can be loaded from the server using WebClient.

    Kind regards,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top