Hello,
I have developed Web application in asp.net in which implemented zip folder and download functionality, I have refered below link :
and I have cutomized my button click event code as per requirement code is :
try
{
using (ZipFile zip = new ZipFile())
{
zip.AlternateEncodingUsage = ZipOption.AsNecessary;
zip.AddDirectoryByName("KMLFiles");
con.Close();
SqlCommand cmd = new SqlCommand("select FilePath from FileMaster where FileType='KML'", con);
con.Open();
SqlDataReader sdr = cmd.ExecuteReader();
if (sdr.HasRows)
{
while (sdr.Read())
{
string filePath = @"G:\Work_Backup2020\WebShreeGroup\ShreeGroupWeb\ShreeGroupWeb\ShreeGroupWeb\" + sdr.GetValue(0).ToString();
zip.AddFile(filepath, "KMLFiles");
}
}
}
and this code worked fine with this local path.
But as it's online web application, I have deployed it on server and edited this local path and given server URl to locate folder, after that my code is :
try
{
using (ZipFile zip = new ZipFile())
{
zip.AlternateEncodingUsage = ZipOption.AsNecessary;
zip.AddDirectoryByName("KMLFiles");
con.Close();
SqlCommand cmd = new SqlCommand("select FilePath from FileMaster where FileType='KML'", con);
con.Open();
SqlDataReader sdr = cmd.ExecuteReader();
if (sdr.HasRows)
{
while (sdr.Read())
{
string filePath = "http://revolutionit-004-site69.htempurl.com/" + sdr.GetValue(0).ToString();
zip.AddFile(filepath, "KMLFiles");
}
}
}
after adding this online server path, it gives error as :
URI format not supported.
how to resolve this issue ?
Thanks