Ankit  Shukla

Ankit Shukla

  • NA
  • 503
  • 23.8k

Access to the path problem

Sep 15 2015 8:38 AM
Hi;
 
    I am creating a zip file by using this code:
 
string pathname = Server.MapPath(string.Format("~/Intimation/" + TBVeh.Text.Trim()));
if (pathname != null || pathname != "")
{
string[] filename = Directory.GetFiles(pathname);
using (ZipFile zip = new ZipFile())
{
zip.AddFiles(filename, "file");
zip.Save(Server.MapPath(string.Format("~/zi.zip")));
 
but it returns this error:
Access to the path 'D:\INETPUB\VHOSTS\sistechnologies.in\gisla.sistech.in\DotNetZip-ul4psvz0.tmp' is denied. 
 
I want to mention that this temp file name always change..
2nd time it shows:
Access to the path 'D:\INETPUB\VHOSTS\sistechnologies.in\gisla.sistech.in\DotNetZip-s3crzvxn.tmp' is denied. 
 
I don't understand from where  these temp file creates... Why I am facing this error.. Please help..
 

Answers (2)