when i try to save this file it creates and folder for the entire path

Posted by girish on Stack Overflow See other posts from Stack Overflow or by girish
Published on 2010-04-28T12:00:13Z Indexed on 2010/04/28 12:03 UTC
Read the original article Hit count: 337

Filed under:

ZipFileToCreate = "c:\user\desktop\webservice\file.zip";

so, when i try to save this file it creates the folder for the path like user\desktop\webservice\file\

why is it so,
                            FileStream fs = new FileStream(ZipFileToCreate, FileMode.Open);
                            byte[] data = new Byte[fs.Length];
                            BinaryReader br = new BinaryReader(fs);
                            br.Read(data, 0, data.Length);
                            br.Close();
                            Response.Clear();
                            Response.ContentType = "application/x-zip-compressed";
                            Response.AppendHeader("Content-Disposition", "filename="
                            + Parameter + ".zip");
                            DeleteOldFiles();
                            Response.BinaryWrite(data);

© Stack Overflow or respective owner

Related posts about ASP.NET