Creates new WebDAV resource with the specified name in this folder.
public WebDAVResponse CreateResource(string name, Stream content, string contentType)
{
if(!ClientHasToken)
return new LockedResponse();
SqlConnection conn = new SqlConnection(connStr);
SqlTransaction trans = null;
conn.Open();
try
{
trans = conn.BeginTransaction();
Resource newResource = (Resource)CreateChild(trans, name, ItemType.Resource);
newResource.WriteContent(trans, content, contentType);
trans.Commit();
}
catch(Exception ex)
{
if(trans != null) trans.Rollback();
throw;
}
finally
{
conn.Close();
}
return new CreatedResponse();
}
IFolder Interface | ITHit.WebDAV.Server Namespace