473,659 Members | 2,987 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6011
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
2268
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 environment and so we are in the process of imposing a WebService gateway between our application client and the repository. (As a starting point, the WebService won't be a richly featured application server; business rules are still implemented in the...
3
1452
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 am using to write the new xml to that same location does not give me any error but the file never updates. When I open the file from XMLSPY with Open URL ... I can read and update it.
15
3491
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 abstract - it's going right over my head. Can somebody explain, in simple/concrete terms what MS SharePoint is? -- PeteCresswell
0
1015
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 sharepoint server document library. I want the user to be able to click on a Word document in the library (a document named 'test 555.doc' for example), and when they click on the link, the url of that file, not the webbrowser's statustext field...
1
1164
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 hit the back button, sometimes it takes me back to the same place in the PDF, other times it takes me back to the very top of the PDF. I have tested the PDF in Sharepoint and just on my server....this only happens when it is uploaded to the...
0
868
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 other sharepoint site resides on a different server farm. Thanks in advance, Ashwin
1
2007
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 server. This functionality exists in sharepoint and I see that visual web developer has a section of tools for webparts so I assume I can somehow use sharepoint webparts in my application. Anyways any help and advice you can offer would be...
1
5534
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 a Folder with the same name as in folder which has been added.For eg if i am creating a folder titled A in a Doc library called A1 then I shud have a folder names A in a document library called as 'Request for Proposals' (this is predifened) below...
2
4396
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 Library using UpdateListsItem method & with it being a clientside i need to pass NT Credentials to the List Please provide code as I have to get this going & have no clue. Please Assist
0
8335
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.