0

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

1 Answer 1

-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.

1
  • 1
    Any method without having to use third party tools?
    – sharmila
    Jan 28, 2013 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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