asp.net - "File not found exception" trying to extract zip archive with DotNetZip -


public void zipextract(string zipfilename, string outputdirectory) {            using (zipfile zip = zipfile.read(zipfilename))//file not found exception     {         directory.createdirectory(outputdirectory);         zip.extractselectedentries("name=*.jpg,*.jpeg,*.png,*.gif,*.bmp", " ",              outputdirectory, extractexistingfileaction.overwritesilently);     } }  [httppost] public contentresult uploadify(httppostedfilebase filedata) {     var path = server.mappath(@"~/files");     var filepath = path.combine(path, filedata.filename);     if (filedata.filename.endswith(".zip"))     {         zipextract(filedata.filename,path);     }     filedata.saveas(filepath);     // createthumbnail(filepath);     _db.photos.add(new photo         {             filename = filedata.filename         });      _db.savechanges();     return new contentresult{content = "1"};   } 

i try extract uploaded zip archive , save extracted files in folder "file not found" exception happens time. what's mistake?

have tried setting break point here, , see value filedata.filename has? (and see if exists on server.)

if (filedata.filename.endswith(".zip"))       {         zipextract(filedata.filename,path);      }  

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -