In Dublin it's always raining, so there's always some time to post a new article. Two useful code snippets for WSS3 developers:
Smartly export a document from a WSS Document Library:
// Set up the webclient with the correct credentials WebClient webClient = new System.Net.WebClient(); webClient.Credentials = credential; // Export the document to the given folder webClient.DownloadFile(documentUrl, docFullPath);
Smartly import (upload) a document to a WSS Document Library:
// Set up the webclient with the correct credentials WebClient webClient = new System.Net.WebClient(); webClient.Credentials = credential; // Upload the file webClient.UploadFile(destinationUrl, "PUT", sourceFilePath);
PingBack from http://msdnrss.thecoderblogs.com/2007/08/12/useful-wss-30-samples/
very much off topic, but whats the point of having "pingbacks" from other sits, who have just copied and pasted your content....
Isnt the whoel idea and concept of WSS/MOSS so you dont have to duplicate information?
I would post this on the other site also, however they dont allow comments.
Regards,
Daniel
What shd be the destinationURL if my Shared Documents URL is
http://my_server_name/Shared%20Documents/Forms/AllItems.aspx
Avi.
Try http://my_server_name/Shared%20Documents
Thank you for the code snippets.
After the upload of the document, it is in a "checked out" status. Is there a simple way to indicate that the document should be marked as "checked in"?
Johan.
Hey Johan,
You need to use the object model or MOSS web services to check the document back in. See http://msdn.microsoft.com/en-us/library/lists.lists.checkinfile.aspx for an example!
Chrs,
David