Community
Vault Forum
Welcome to Autodesk’s Vault Forums. Share your knowledge, ask questions, and explore popular Vault topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add new file returns folderID as -1

1 REPLY 1
Reply
Message 1 of 2
Anonymous
209 Views, 1 Reply

Add new file returns folderID as -1

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

1 REPLY 1
Message 2 of 2
Redmond.D
in reply to: Anonymous

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

 



Doug Redmond
Software Engineer
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report