It is of course possible to upload files by code.
There are 2 ways:
Either you use full object model, so as it was said you can create a
webpart and upload the files from there one by one, or you can say
here is the location to the folder and upload all of the files in
that folder.
Or you can write client side code, I'm talking now about client side
application, it can just be a console .Net application which would
use SharePoint API and also for example by the parameters passed to a
folder upload all files in the folder.
Basically everything is possible in your situation.
Here is just some sample which you can start from:
// Getting a reference to the document library
using(SPSite site = new SPSite("http://localhost"))
{
using(SPWeb web = sp.OpenWeb())
{
var folder = web.GetFolder("Documents");
var files = folder.Files;
// Opening a filestream
var fStream = File.OpenRead("C:MyDocument.docx");
var contents = new byte[fStream.Length];
fStream.Read(contents, 0, (int)fStream.Length);
fStream.Close();
// Adding any metadata needed
var documentMetadata = new Hashtable {{"Comments", "Hello World"}};
// Adding the file to the SPFileCollection
var currentFile =
files.Add("Documents/MyDocument.docx", contents, documentMetadata, true);
}
}
I hope it was helpful, happy coding!