I have a set of 200 excel files which I need to update on our SP server.
They originate on a network drive - I will use C#
to move these files into their destination document library.
The files are around 400KB in size and moving such files around our network drives is instantaneous.
Here is the code I'm using for a single file move:
using System;
using System.IO;
namespace MoveFilesToSharepoint
{
class Program
{
static void Main(string[] args)
{
string sourceDirX = @"\\networkfileserve\aDirectory\aFolder\example.xlsx";
string destDirX = @"\\SPserver\subsiteName\docLibName\example.xlsx";
Console.WriteLine(DateTime.UtcNow.ToString());
File.Copy(sourceDirX,destDirX,overwrite: true);
Console.WriteLine(DateTime.UtcNow.ToString());
Console.WriteLine("press [enter] to exit");
Console.WriteLine("");
Console.Read();
}
}
}
On my machine this takes 15 seconds - on my colleagues higher spec machine 10 seconds - this time is obviously practically unacceptable.
Are there settings within sharepoint that I need to change - maybe in respect of the document library to speed up this upload?