How can I compress data when upload a file?

2 posts, 0 answers
  1. Calvin
    Calvin avatar
    1 posts
    Member since:
    Nov 2010

    Posted 10 Nov 2010 Link to this post

    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
  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 12 Nov 2010 Link to this post

    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
  3. DevCraft banner
Back to Top