Hi All,
I need to add a new file to vault through API. i am using the below code.
Autodesk.Connectivity.WebServices.File fileOut = _docSvc.AddFile(95, FileName, "",
System.IO.File.GetLastWriteTime(filePath), null, null, fileClass, false, fileData);
The file is added successfully. i am sure that the folderID in which i am adding the file is 95. But in the 'fileOut' am getting chkoutfolderID and OriginalFIleID as '-1'. Please refer attached screens. Kindly suggest me how to add a new file and in turn get the folderID and original file ID.
Regards,
Navadeebans
When you create a new file, it's not checked out. CkOutFolderId only applies to checked out files, so there's nothing wrong with a -1 value.
OrigFileId doesn't apply to the first version. When a new version is created, meta data from the old version is copied over and OrigFileId is the source file ID. I don't recommend doing anything with OrigFileId. It's been removed in later versions of the API. I think it would always just point to the X-1 file version, but there are better ways to get file history.
Also, there is a discussion group just for Vault API issues. http://forums.autodesk.com/t5/Vault-Customization/bd-p/301