Hi I have the following piece of code to upload a file to Sharepoint. It uses HTTP PUT:
public static string UploadFile(string destUrl, string sourcePath)
Is there a paticular reason you can't just use the Sharepoint API (eg. SPFolder.Files.Add) to upload the file? As follows:
http://msdn.microsoft.com/en-us/library/ms454491.aspx
public void UploadFile(string srcUrl, string destUrl)
{
if (! File.Exists(srcUrl))
{
throw new ArgumentException(String.Format("{0} does not exist",
srcUrl), "srcUrl");
}
SPWeb site = new SPSite(destUrl).OpenWeb();
FileStream fStream = File.OpenRead(srcUrl);
byte[] contents = new byte[fStream.Length];
fStream.Read(contents, 0, (int)fStream.Length);
fStream.Close();
EnsureParentFolder(site, destUrl);
site.Files.Add(destUrl, contents);
}