views:

647

answers:

3

I am updating Documents on Sharepoint using the List.asmx web service.

But problem I am facing is:

  1. Fields are not getting updated as some of required fields are not added. But to fill required fields I have to Update again.
  2. "ID" field is compulsary at the time of Update. Which we get only after uploading Document. (We get this id by "ows_id" attribute value.)

Edit: As said by "Janis Veinbergs" We can't get this ID until document is actualy saved. So how will I update document as ID field is must for Update?

If I don't Put ID Field:

Error : 0x8102000aInvalid URL Parameter The URL provided contains an invalid Command or Value. Please check the URL again.

If I put Null Value to it:

Error :0x81020016Item does not exist The page you selected contains an item that does not exist. It may have been deleted by another user.

Is there any way to set document properties at the time of uploading files on Sharepoint?

*Note: I am uploading file in Chunck.And Not using Microsoft.sharepoint.dll * Language: C#.

I tried this code. But here again properties are being set after uploading file.

+1  A: 

number 2 -> One is for sure - you can't get database row ID of document before it is actually saved into database.

Janis Veinbergs
+1  A: 

What does your XML look like? Are you using this kind of technique?

http://msdn.microsoft.com/en-us/library/lists.lists.updatelistitems.aspx

David Patrick
+1  A: 

The page linked to in the question actually links to a newer option using a FrontPage RPC method to post documents to SharePoint: http://geek.hubkey.com/2007/11/upload-file-to-sharepoint-document.html

I would use that instead.

If you need to upload multiple files, you can use this method. If you need to upload one file, try this one.

schellack