Problems with filerights when using in an ASP.NET application


When using the Library in an ASP.NET(2.0) application an user rights exception is thrown when the application is used. This did not happen while developing with the ASP.NET development server. But when released to a windows 2003 server there were problems with the file rights.
The problem seems to be that the code asks the system for a temporary file with System.IO.Path.GetRandomFileName(); This returns a file in the windows/system32/inetsrv folder. The asp.net process did not have rights to create the file. A quick fix could be done by giving the users write rights in that folder.
The problem can also be solved by adding an extra constructor with the possibility to provide an alternative location for the temporary file (in my case zipfile + .tmp). This fixed the problem for me.
I attached my changed file ZipFile.cs. This file also contains a little check to see if the temp file is not the same as the archive file.

file attachments

Closed Feb 5, 2008 at 9:00 PM by Cheeso
fixed in v1.3


pbaxter wrote Nov 25, 2007 at 8:50 PM

I had the same issue but added a TempFolder property to the class -- when the tempname is constructed, the tempfolder property is used if specified. So, at run time, I send in a folder that our ASP.NET app has r/w access to. otherwise it works as is before. Different approach than the previous.

Cheeso wrote Feb 5, 2008 at 9:00 PM

fixed in change set 14493.

** Closed by Cheeso 2/4/2008 6:19 PM

Cheeso wrote Feb 5, 2008 at 9:00 PM

re-opening to assign to a release.