Question

I have added a menu item in ECB of document of document library. On click of that menu i want to copy that document to my application. For this purpose i need to create a temporary file of the document on the same machine where SharePoint server is installed. Now the problem is that where should i create the temporary file. One solution is TEMP folder of current user(who has logged in sharepoint). But in sharepoint, Users from Active Directory can also login but temp folder is only available for users on that machine. In short requirement is to create temporary file in a folder where every user (users on that machine as well as AD users) have rights to create and delete file.

Does sharepoint recommend any specific location for this purpose?

Was it helpful?

Solution

SharePoint uses .NET, so you should use .NET features for this:

string tempFilename = System.IO.Path.GetTempFileName();

The service account's notion of TEMP will be used, not the logged-in user's.

-Oisin

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top