Compress file data before returning to the client

2 posts, 0 answers
  1. Dave
    Dave avatar
    8 posts
    Member since:
    Jul 2006

    Posted 05 Jan 2011 Link to this post

    I have an application where users upload PDFs and images. I would like to minimize the size of these files by compressing them or using a library to reduce the image quality.I feel that I could probably find a server-side library more easily than a silverlight one for compressing/quality lowering. So, is there a way in the RadUploadHanlder to get the file data, manipulate it, and then return it to the client? The client app would then later save the file to a database in the compressed format.


  2. Alex Fidanov
    Alex Fidanov avatar
    637 posts

    Posted 11 Jan 2011 Link to this post

    Hello Dave,

    From the FileUploadStarting event, you can modify the file stream of the file before it is being uploaded. It is available through the event's args e.NewFileStream. You can use this in case a silverlight compressing library. If you are using a server sider compression library, you would not be able to return the compressed file stream back to the client. You can return parameters, but they will be just string parameters.

    All the best,
    Alex Fidanov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top