SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

%temp% directory

Last post 10-05-2008 9:23 PM by JohnReilly. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-30-2008 11:47 AM

    %temp% directory

    In ASP.Net when using the code:

    zipFile.Add(.....);
    zipFile.CommitUpdate();

     I get an "invalid directory" exception on the commitUpdate statement. Looking at the stack trace it appears that SharpZipLib is trying to use

    System.IO.Path.GetTempPath()  and create a temp file in the %temp% directory.

    If I set in the web.config  impersonate to true and give a local user account then the CommitUpdate will work fine.
    <identity impersonate="true" username="..." password="...."  />

     

    I am sure all this is by design, but could someone clarify what is happening?

    Is there a way I could set the temp directory it uses to somewhere else?

    Is there a way of this code working in asp.net without using impersonation?

  • 10-05-2008 9:23 PM In reply to

    Re: %temp% directory

    Hi,

    The default implementation of IArchiveStorage for hard disk (DiskArchiveStorage) does this when ZipFile updates are run.

    There is a MemoryArchiveStorage storage which stores data in memory which may help also. You can create your own implementation that handles this however you like.  These are specified when BeginUpdate is called.

    Note that it is possible to not use temporary storage at all but this isnt recommended. 

    Have a look into it and it shouldnt be too hard to sort out how you like.

    hth, -jr-

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.