You can upload files into your Sharepoint repository in one hit along with metadata (ie custom column information and values). You just have to Reference the SharepointSite/_vti_bin/copy.asmx (e.g. http://dev-moss/sites/home/PropertySharePoint/_vti_bin/copy.asmx) to get access to the Copy.CopyIntoItems() method. You then simply pass in the stream and Array of FileInfo objects (which have your metadata) into this method. I have seen several examples around that use the Http PUT method (e.g. http://www.sharepointblogs.com/ssa/archive/2006/11/30/wsuploadservice-web-service-for-uploading-documents-into-sharepoint.aspx)and and then grab the file back and update it with the meta data. My code sample below shows a much simpler way. I have not seen this technique is some of the larger Development guides such as SAMs MOSS 2007 Development Unleashed - they only give a passing mention to the copy service. MSDN also brushes over this service - http://msdn2.microsoft.com/en-us/copy.copy.copyintoitems.aspx
/// <summary>
///
/// </summary>
/// <param name="listName"></param>
/// <param name="destinationfolderPath"></param>
/// <param name="sourceFileSteam"></param>
/// <param name="fileName"></param>
/// <param name="fields"></param>
/// <returns>String with the destination Uri</returns>
public uint UploadFile(string listName, string destinationfolderPath, Stream sourceFileSteam, string fileName, SharepointCopyProxy.FieldInformation[] fields )
{
//Create folder if it doesn't exist
CreateFolder(listName, destinationfolderPath);
byte[] fileBytes = new byte[sourceFileSteam.Length];
sourceFileSteam.Read(fileBytes, 0, (int)sourceFileSteam.Length);
string[] destinationUri = {string.Format("{0}/{1}/{2}/{3}",_urlSiteRoot, listName, destinationfolderPath, fileName)}; //This may have issues as the listname may be different to the full path - may need to get value from folder path
SharepointCopyProxy.CopyResult[] result;
uint documentId = _copyWebService.CopyIntoItems("http://null", destinationUri, fields, fileBytes, out result);
if (result[0].ErrorMessage != null)
{
throw new System.ApplicationException("An error occurred uploading the file to Sharepoint.", new System.Exception(result[0].ErrorMessage));
}
return documentId;
}