Passing uri to Document.Save()


#1

I saw the example in http://www.aspose.com/Community/forums/ShowThread.aspx?PostID=6485. After manipulating the document, how do I save it back to the original uri?

Thanks,
Joe


#2

Please disregard. I got it to work this way:

. . .
saveToUrl(doc, url);

private void saveToUrl(Document doc, string url)
{
MemoryStream source = new MemoryStream();
doc.Save(source, SaveFormat.FormatDocument);
byte[] sourceBytes = source.GetBuffer();

WebClient client = new WebClient();
client.Credentials = System.Net.CredentialCache.DefaultCredentials;
Stream target = client.OpenWrite(url, “PUT”);
target.Write(sourceBytes, 0, sourceBytes.Length);

source.Close();
target.Close();
}