Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am working with SharePoint 2010. I need to get the data from excel file stored in sharepoint library. I have plans to accomplish this by using OLEDB connection. So I need to download the excel file from doc library and store it in a temporary location and then access this temp file to get data from it. Now my question is which is the best ans safe location to stored the downloaded file? So far I have used SharePoint's layouts directory, C:windows:TEMP and even Path.GetTempFileName(). But the result I get this is " ACCESS DENIED!". Any ideas in temporary location? Is there any other location which is safe?

Thanks

share|improve this question

1 Answer 1

I don't think that there is a temporary location. Work in Memory instead:

Get the File:

byte[] data = web.GetFile("YOURFILEURL").OpenBinary();

To read the data you can use Tools like Aspose.Cells. Like this:

Workbook workbook = new Workbook(data);

With the Workbook object you can access your payload data.

share|improve this answer
    
Any method without having to use third party tools? –  sharmila Jan 28 '13 at 10:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.