On-the-fly zipping using Ionic.Zip c# -


i trying create zip file stream , in return stream, problem don't want store data in local hard disk or in memory. using ionic.zip library

        stream output = new memorystream();         using (zipfile zip = new zipfile())         {             stream s = ftpmanager.getfilestream("/mydoc.docx");             zipentry e = zip.addentry("content-from-stream.bin", s);             e.comment = "the content entry in zip file obtained stream";             //zip.addfile("readme.txt");             zip.save(output);         }         if (output != null)         {             ftpmanager.upload(output, "/mohamedtest/mydoc.zip");         } 

there many problems in code,

  • first, using memorystream not preferable
  • second, zipped file empty after compress

any suggestions

most position on output set end of stream after compression, please check this. and, unless implement proxyfying stream (which handle .write method , send data ftp) need memory/file stream store zipped data.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -