public object DownloadFile(string Id)
        {
            if (Id == null)
            {
                return(RedirectToAction("NotFound", "Error"));
            }

            var             context = new DatabaseContext();
            List <Document> ObjDocs = context.Documents.ToList();

            // get document data by propertyId
            var doc = (from FC in ObjDocs
                       where FC.Id.Equals(Id)
                       select new { FC.Id, FC.PropertyId, FC.FileName, FC.DocBlob }).ToList().First();

            if (doc == null)
            {
                return(RedirectToAction("NotFound", "Error"));
            }

            string testDoc = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings.Get("testDocPath"));

            MemoryStream ms = new MemoryStream();

            using (var streamreader = new MemoryStream(doc.DocBlob))
            {
                using (ZipFile zip = ZipFile.Read(streamreader))
                {
                    if (zip.Count == 0)
                    {
                        return(RedirectToAction("NotFound", "Error"));
                    }
                    // Unzip/decrypt file using given password
                    ZipEntry entry;
                    entry = zip[testDoc];
                    entry.ExtractWithPassword(ms, UploadController.GenerateSecretKey(doc.Id, doc.PropertyId));
                }
                return(File(ms.GetBuffer(), "application/octet-stream", doc.FileName));
            }
        }