"Alan Sloan" <No****@comcast.netwrote in message
news:%2*****************@TK2MSFTNGP06.phx.gbl...
I've written a web service in VS2005 that uses a COM object to get a file
out of another system. I eventually need to stream the file to the
consumer, but I first need to get the file to a temporary location. I'd
like this temporary location to be a subfolder in my web service. When I
attempt to get the file to /WebService/tmpFolder/filename.pdf it fails.
If
I get the file to My.Computer.FileSystem.SpecialDirectories.Temp it works,
but I'd really rather it be written to the folder mentioned above.
Is there something I'm missing(permissions wise or other) that isn't
allowing it to write to a subfolder in my web service?
Any help would be greatly appreciated.
ASP.NET Web Services, like ASP.NET Web Applications, run in a restricted
context. Part of that context is that they usually run under an account
which does not have access to write to disk.
Take a look at the application in IIS Manager. Look at the Directory
Security tab of the Properties of the virtual directory. Click the "Edit"
button. If you have Anonymous access enabled, then take a look at the user
name that the application runs under. This is the user which will need write
access to your temporary directory, and (I think) List Contents access to
the parents of your temporary directory.
HTH,
--
John Saunders [MVP]