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

How can I compress data when upload a file?

1 Answer 91 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Calvin
Top achievements
Rank 1
Calvin asked on 10 Nov 2010, 05:33 PM
I use the SL Upload for uploading a big file.I want to compress the byte[] read from the filestream at client-side,and decompress the byte[] at server-side.And I don't want to read the whole file into the memory,just read the size of the byte[] from the filestream.
I think I can override SaveChunkData() method of the RadUploadHandler class to decompress data.But I don't know how to do compression at client-side.How can I do it?
Thanks

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 12 Nov 2010, 12:30 PM
Hi Calvin,

In this scenario, you can use the e.NewFileStream property of the event arguments of the FileUploadStarting event. There you can pass the compressed stream of the file before it starts uploading. You can decompress it on the server side by overriding the SaveChunkData method and checking the IsFinalFileRequest() method. Compression and decompression is currently not out of the box feature, so you would have to do this manually with any public compression/decompression library.

Best wishes,
Alex Fidanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Upload
Asked by
Calvin
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Share this question
or