Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie question to Sharepoints Webservices.

Status
Not open for further replies.

LarsDahl

Programmer
Mar 3, 2005
9
DK
Hi!

I'm working at developing a program who can use Sharepoints webservices to upload a file to a documentfolder at a Sharepoint site.

The Sharepoint Webservices:

So far I have figured out to upload a picture to a picture library, using the Upload method of the Imaging webservice.
And I have figured out how to add a file to a list item, using the AddAttachment method of the Lists webservice.

... But ... What I want is to upload a file to a document library.
Do anyone have a good clue to how I do this? [ponder]

---

I've tried to search the net for any hint, but I usually end up at the same page:
But that's useless, because I'm not intending to write a custom web service. - Just only use those who allready exists!
 
I've tried another appoach: (Here C# code)
Code:
	System.Net.WebClient WC = new WebClient();
	WC.Credentials = CredentialCache.DefaultCredentials;
	Byte[] b = WC.UploadFile("[URL unfurl="true"]http://WeirdServerName/personal/WeirdUserName/Private[/URL] Documents/", "POST", @"D:\WeirdFileName.txt");
	MessageBox.Show(System.Text.Encoding.ASCII.GetString(b));
Which show a succes result, but nothing arrives at the destination!?
As far as I have figured out, it requires a certain setting at the receiving server, so if it is because it is disabled for Sharepoint, then it again will require modification at the server-side. (Which I'll prefere to avoid.)

Any better idea?
 
From:
(Scrolling down to headline "Documents and Windows SharePoint Services" and onward)
It tells to use the Office Object Models "SaveAs" with an URL ... and SURPRISE!!! it works!
But ... well ... Though I haven't completely understand how this works (It maybe use WebDAV (What ever that is???)) ... it seems not to be through webservices ... or ?
Do anybody know?

Yes... I'm currently working on a plugin for Outlook. So it could be nice to be able to let the user navigate to where to put the document. The Office Object Model do have a "FileDialog" method, but it is located (named?) different in each office part. So far I've found it in Word and Excel, but not yet in Outlook...
Where is it in Outlook?
When clicking "Save As" in Outlook it is used ... so ... obvious ... it is there (Somewhere)!

But still, it seems not to be the best approach ... at least, I haven't figured out to set the metadata (You know those SharePoint can use for sorting and categorizing (and users often forget to fill in!)) with this approach.
How do I supply (or add) metadata with this "SaveAs" approach?
Yes, it requires, too, the ablilty to read which metadata the target Document Library uses.
 
Sad so few who has given comments to this thread.
What's wrong?

Is my questions unclear? (Sorry, english isn't my native language.)

Or is it ended in the "leave the too easy questions to others. - thinking that someone else would answer them." void?

Did I post it in the wrong forum?
Please tell me where I find a good forum for SharePoint.
 
Hello,

I do not think your question is unclear, I am unfortunately not able to help you here since I am not a programmer. But you could take a look at there is a forum especially for SharePoint development.

Regards,
Thomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top