473,396 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Retrieve file on a Sharepoint Document Library using other credent


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
1 6003
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Joseph Geretz | last post by:
Up to this point, our application has been using Windows File Sharing to transfer files to and from our application document repository. This approach does not lend itself toward a secure...
3
by: Joel | last post by:
Hi, I have an XML file at http://localhost/test.xml that I want to read and then update. I can get and read the file no problem with GetResponseStream etc... The code (see 2 examples below) I...
15
by: (PeteCresswell) | last post by:
Got a sample of MS's "Advisor Guide To Microsoft Access" in the mail today - accompanied by a sample "Advisor Guide To Microsoft SharePoint". I skimmed both, but the SharePoint explanation is too...
0
by: Josiah Smith | last post by:
Hi, I'm using MS Office Infopath in a hosted application, but for simplicity's sake, I'll use Word as an example in describing my problem. I have a hosted webbrowser control that links to a...
1
by: =?Utf-8?B?TWljaGVsbGU=?= | last post by:
Hi, I have a document library set up in Sharepoint where i have saved several PDF documents. Each of these documents have links within them. When i click on a link in the PDF it opens up, when i...
0
by: Ashwin Kumar | last post by:
Hi, Could anyone help me out to write a web service which copies a file from a document library of a sharepoint site to another document library of another sharepoint site. Please note that the...
1
by: tagg3rx | last post by:
Hi all, I'm trying to figure out how to facilitate a window in my web application that will allow users to drag and drop files into it which will inturn trigger the files being uploaded to my...
1
by: jags | last post by:
HI All I was trying to create Document librray programatically in a Sharepoint Site and is not working for me.I was trying to implement this as an Event Handler. The aim of the code is to create...
2
by: ismailc | last post by:
Good day, I need help. I would like to Update a Sharepoint List (Document Library) Folders using Web Services with Javascript. I have searched on Goggle but nothing that updates a document...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.