Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Update Sharepoint Document Properties: Required Fields are Empty

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.

like image 809
Preeti Avatar asked Mar 10 '10 11:03

Preeti


2 Answers

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

like image 177
Janis Veinbergs Avatar answered Nov 14 '22 22:11

Janis Veinbergs


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.

like image 34
schellack Avatar answered Nov 15 '22 00:11

schellack