Kindly replace you existing css class with mine and the issue is resolved
css
.form-group {
position: relative;
align-items: baseline;
background: green;
}
progress{
height: 3px;
background-color: #291919;
width: 100%;
color: yellow;
position: absolute;
z-index: 9;
left: 0;
border-radius: 1px;
margin-top: 0em;
display: flex;
}
Вы не должны больше пользоваться внешней библиотекой. Система. IO.Packaging имеет классы, которые могут использоваться для бросания содержания в zip-файл. Не простой, как бы то ни было. Вот сообщение в блоге с примером (в конце; выройте для него).
Ссылка не стабильна, таким образом, вот является пример Jon, предоставленным в сообщении.
using System;
using System.IO;
using System.IO.Packaging;
namespace ZipSample
{
class Program
{
static void Main(string[] args)
{
AddFileToZip("Output.zip", @"C:\Windows\Notepad.exe");
AddFileToZip("Output.zip", @"C:\Windows\System32\Calc.exe");
}
private const long BUFFER_SIZE = 4096;
private static void AddFileToZip(string zipFilename, string fileToAdd)
{
using (Package zip = System.IO.Packaging.Package.Open(zipFilename, FileMode.OpenOrCreate))
{
string destFilename = ".\\" + Path.GetFileName(fileToAdd);
Uri uri = PackUriHelper.CreatePartUri(new Uri(destFilename, UriKind.Relative));
if (zip.PartExists(uri))
{
zip.DeletePart(uri);
}
PackagePart part = zip.CreatePart(uri, "",CompressionOption.Normal);
using (FileStream fileStream = new FileStream(fileToAdd, FileMode.Open, FileAccess.Read))
{
using (Stream dest = part.GetStream())
{
CopyStream(fileStream, dest);
}
}
}
}
private static void CopyStream(System.IO.FileStream inputStream, System.IO.Stream outputStream)
{
long bufferSize = inputStream.Length < BUFFER_SIZE ? inputStream.Length : BUFFER_SIZE;
byte[] buffer = new byte[bufferSize];
int bytesRead = 0;
long bytesWritten = 0;
while ((bytesRead = inputStream.Read(buffer, 0, buffer.Length)) != 0)
{
outputStream.Write(buffer, 0, bytesRead);
bytesWritten += bytesRead;
}
}
}
}
DotNetZip хорош для этого. Рабочий пример
Можно записать zip непосредственно в Ответ. OutputStream. Код похож на это:
Response.Clear();
Response.BufferOutput = false; // for large files...
System.Web.HttpContext c= System.Web.HttpContext.Current;
String ReadmeText= "Hello!\n\nThis is a README..." + DateTime.Now.ToString("G");
string archiveName= String.Format("archive-{0}.zip",
DateTime.Now.ToString("yyyy-MMM-dd-HHmmss"));
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "filename=" + archiveName);
using (ZipFile zip = new ZipFile())
{
// filesToInclude is an IEnumerable<String>, like String[] or List<String>
zip.AddFiles(filesToInclude, "files");
// Add a file from a string
zip.AddEntry("Readme.txt", "", ReadmeText);
zip.Save(Response.OutputStream);
}
// Response.End(); // no! See http://stackoverflow.com/questions/1087777
Response.Close();
DotNetZip свободен.
Я использовал свободный компонент от chilkat для этого: http://www.chilkatsoft.com/zip-dotnet.asp. Делает в значительной степени все, в чем я нуждался однако, я не уверен в создании файловой структуры динамично.