Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Does any one knows how to get the document id after uploading it to sharepoint using a single web service? So by using one call i can upload the document and get it's id.

I looked at Copy.asmx web service, but it returns zero to indicate that the operation has been completed and a result that does not contain the document id.

Thank you for your time.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

We can get the List Item ID or Document id based on Document url using SiteData webservice.

We can use SiteData.GetURLSegments method, by passing document url and then we can retrive the List ID, WebId and Document id.

For ref, http://msdn.microsoft.com/en-us/library/ms774739(v=office.12).aspx

share|improve this answer
    
Ok. But i will need two web services calls. one to upload the document using Copy.asmx, and the other to get it's id using SiteData.asmx. Can i upload the document and get it's id with one service call? –  user3470 Aug 22 '11 at 7:23
    
no as far as I know, you can not achieve this with one service call –  GillouX Aug 22 '11 at 7:48
    
No, we can't achieve the requirement with single web service call. Copy service especially for uploading document, so we can't get the document id from this web service. So we have to go for another webservice. –  Shantha Kumar Thambidurai Aug 22 '11 at 8:15

do you try to make a EventHandler? you can save the document id on a new column created by yourself, I don't understand so much the question but I think can be useful for you... greetings!

MCS

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.