Cannot delete file in share using impersonation in ASP.NET

We have a web farm and write temporary files for reports. We created a file share and use impersonation to write temporary report files to this resource. We have provided an account that exercises full control over the personification of the shared resource and the folder itself.

Files are written correctly, but not deleted. Is there something we are missing in this setup?

+4
source share
3 answers

Not sure which method you use to write files. The following is what I did to read files. Perhaps you can also try this method to remove them.

How to temporarily impersonate a user to open a file?

+1
source

Check the "access denied" error message in the event viewer and double-check that the user you expect to delete is the actual user.

0
source

forces you to close the file in the procedure that you use to write to files, otherwise it will be blocked

0
source

Source: https://habr.com/ru/post/1299764/


All Articles