473,809 Members | 2,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check if file exists in Sharepoint

64 New Member
Hi there,

can anyone help me for the code to check if a file exists on the sharepoint link
and what object I need to pick up from the reference(if any)

Thanks
Yogesh
Feb 5 '09 #1
1 9594
ykhamitkar
64 New Member
Hi there,

I have found following code trough which I can download the file from sharepoint
but I want to check if the file exists on sharepoint (Dont want to download all the files from sharepoint since I am dealing with 80,000 files)

Any thought
Thanks

Private Declare Function URLDownloadToFi le Lib "urlmon" Alias _
"URLDownloadToF ileA" ( _
ByVal pCaller As Long, ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long


Sub DownloadFileFro mWeb()
Dim i As Integer

Const strUrl As String = "https://dspace.de.intra net.db.com/site0194/Final Data Repository/Lehman Brothers/Commodities/Close-out Documentation/Lehman Final Analysis - US Power.xlsx"
Dim strSavePath As String
Dim returnValue As Long

strSavePath = "c:\Documen ts and Settings\khamyo g\Desktop\Lehma n Final Analysis - US Power.xlsx"
returnValue = URLDownloadToFi le(0, strUrl, strSavePath, 0, 0)

'MsgBox returnValue
End Sub
Feb 6 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
5831
by: zxkuqyb | last post by:
I've written a simple ASP .NET web application that reads a text file and displays it in the web browser. Works fine when reading a local path; but fails with "can not find a part of the path", or "can not access network file" when attemting to access a UNC network path. I am using IIS 6.0 on Server 2003. SharePoint Portal Server is also installed on this server. I have granted full access to 'everyone' on the network file. An...
5
26305
by: Naamat | last post by:
Hello, I am the sample FPSEPublish (http://blog.baeke.info/blog/_archives/2005/3/3/393158.html) code to upload a document to Sharepoint (WSS). This works perfectly for samll documents. Problem: When I attempt to upload a huge document (300Megabayte) on a PC with 3.6Gig RAM I am getting a OutOfMemoryException when the program attempts to read the
0
1853
by: cherry | last post by:
Dear All, I have written a program in sharepoint, in which will call a Web Service of another Sharepoint portal server so that documents from sharepoint portal server A can push document to Sharepoint portal Server B whose domain is stood alone. However, the program is unable to upload file over 2MB, when the file size exceeds, timeout will occur! I have tried to make a change in the web.config and machine.config of sharepoint portal...
4
2430
by: Ronald S. Cook | last post by:
I've always used Visual SourceSafe for checking in/out source code. We also used it for deliverables (e.g. functional specification document), but should we be using SharePoint for that instead? And what's happening to Visual SourceSafe.. is it going away? I'd like to understand if/how Visual Studio "Team Edition" (I guess I mean Team Foundation Server) addresses this. Thanks in advance for any responses.
2
4167
by: Peter S. | last post by:
I have an ASP.NET page that invokes a web control written in C#. What I want to do is (based on the session ID) display a certain spreadsheet that exists on a network drive. I want the webcontrol to open the spreadsheet using my log on credentials since they won't have priviliges to access their particular file from the network drive. BTW, I am guessing I will have to use HTTP as this file exists in a Sharepoint document library. I can...
3
7136
by: colintanner | last post by:
I've a test web site set up as a virtual directory under default web sites in IIS. However when I browse to the main .aspx page I get an error because it is referencing a web.config that belongs to sharepoint web sites. How can I force the test web site to reference the correct web.config file? The test web site contains the following in IIS: Default Web Site Test - contains aspx and web.config
1
2259
by: Drew Carter | last post by:
Hi. I'm not sure whether this is a SharePoint or an ASP problem... but I thought it made sense to post here. I'm having trouble instantiating a C# class from within my ascx file. When I attempt to run it on our SharePoint 2007 server, I receive this error in the log file: "System.Web.HttpCompileException: c:\Program Files\Common Files\Microsoft Shared\web server...
1
7845
by: Fao, Sean | last post by:
I was wondering if there was any way to programmatically determine whether or not a group exists in SharePoint. I checked the SPGroupCollection in the SPWeb.SiteGroups property and didn't see any methods for doing lookups. I could obviously write my own code that loops through each group, but I was wondering if there was an easier/cleaner way to accomplish this task. Thank you in advance, --
0
1331
by: =?Utf-8?B?U2FkaG5h?= | last post by:
HI , I am using MOSS 2007 API's to implement the version controls like check in and check out in Visual Studio 2005. I have a sharepoint 2007 server and i am accessing the MOSS API (on sharepoint server) from dotnet web application on my local machine using a custom webservice. I am able to check out the document on the sharepoint server by calling the API "item.File.CheckOut();" method via custom webservice. But once i check out the...
0
9603
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
10643
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...
0
10378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9200
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...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
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
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.