By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,179 Members | 2,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,179 IT Pros & Developers. It's quick & easy.

Retrieve file on a Sharepoint Document Library using other credent

P: n/a

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

Jun 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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?

"Peter S." wrote:

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

Jun 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.