Retrieve file on a Sharepoint Document Library using other credent

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

There are some files in a Sharepoint document library that I need to access
from a C# Webcontrol. The problem is that when the user runs the ASP.NET
webpage they will be coming in with a non-privileged account. In the C#
program I would like to access the Document Library (using my credentials)
and make the proper file(s) available. I would like to pull the files locally
where I can provide them access.

One thought I had was to have the C# program temporarily map a network drive
but that is not a desirable option. I am not sure if FTP is another method.
I know currently I can map a network drive using the "http://xxxx" URL that I
use to access the document library. Any ideas how I can get at these files
but come in with my own account????
 
From tooling around Google I discovered that this is a WebClient
class that can get me the file through HTTP protocol and specifying
my own credentials. That would be perfect. I could download the
file locally and then open it. However it would be nice to just open
the (Excel) file for viewing without that step.

There seems to be an OpenRead() function but that returns a stream.
Is there a way I can open the file and present it for viewing to the
user? I don't want to retranslate the stream to a grid because the
file contains graphs etc. Any ideas?

Also can WebClient be utilized to somehow get a listing of files in
the Sharepoint Document library as well?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top