473,320 Members | 1,829 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,320 software developers and data experts.

Check if file exists in Sharepoint

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 9510
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 URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" ( _
ByVal pCaller As Long, ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long


Sub DownloadFileFromWeb()
Dim i As Integer

Const strUrl As String = "https://dspace.de.intranet.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:\Documents and Settings\khamyog\Desktop\Lehman Final Analysis - US Power.xlsx"
returnValue = URLDownloadToFile(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
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...
5
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. ...
0
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...
4
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? ...
2
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...
3
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...
1
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...
1
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...
0
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.