I have managed to solve this! If anyone elses gets the problem, here are the details:
As mentioned, I run the site using impersonation (as a user called WEB). When the error message mentioned the system temp folder, I assumed it was the Windows\Temp folder. After spending ages trying to get this to work, I finally used Process Monitor (www.sysinternals.com
) to track the problem down.
It turns out that it is not trying to use the Windows\Temp folder. Instead, in this case it was trying to access the I:\\NetworkService\AppData\Local\Temp folder. I cannot find a way to get to this folder (under Vista).
I finally resolved this by creating a folder on my c drive (c:\temp) and granting the WEB impersonated user full control over this new folder.
Hope this might help someone else. It has taken me ages to track down!