February 9th, 2013, 01:32 PM
Copying file from local to SharePoint server location
Now on my PC I can use explorer to open a location on our SP server (location eg ht tps : / / sp.myserver.com/site/Documents/). And from there I can copy/paste a file from eg my C:\ drive.
I need to replicate the copy process progmatically. FileCopy() doesn't do it - seems to be the http:// bit that's causing problems I reckon?
February 10th, 2013, 11:40 PM
I use INDY components to down load a file from a URL, perhaps it will solve your problem:
I have these units added to my uses clause:
IdHTTP := TIdHTTP.Create(nil);
URL := 'https://sp.myserver.com/site/Documents/filetodownload.txt';
LocalFile := 'C:\YourSaveFilePathHere\FileName.txt';
FS := TFileStream.Create(LocalFile, fmCreate);