This is a migrated thread and some comments may be shown as answers.

Compress file data before returning to the client

1 Answer 60 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 06 Jan 2011, 12:24 AM
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.

Thanks,

Dave

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 11 Jan 2011, 08:44 AM
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>>
Tags
Upload
Asked by
Dave
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Share this question
or