Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add File to Vault 2014

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
amitnkukanur
1341 Views, 3 Replies

Add File to Vault 2014

Hello,

 

I am trying to add a file to Vault Professional 2014 using C# as development language. This is my below section of code. Though the code does not produce any error but still i am getting exception SOAP Exception 8000.

 

Can some body please suggest me where am i going wrong..

 

 

using (FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
{
ByteArray fileData = new ByteArray();
fileData.Bytes = new byte[stream.Length];
stream.Read(fileData.Bytes, 0, fileData.Bytes.Length);
mgr.DocumentService.AddUploadedFile(Folder2,System.IO.Path.GetFileName(filePath), "", System.IO.File.GetLastWriteTime(filePath), null, null, FileClassification.None, false, fileData);
}

 

 

Senior Software Engineer
3 REPLIES 3
Message 2 of 4
minkd
in reply to: amitnkukanur

Message 3 of 4
Redmond.D
in reply to: amitnkukanur

The easy way of doing it is to use Connection.FileManager.AddFile()



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 4 of 4
amitnkukanur
in reply to: Redmond.D

Thank you Dave for providing a link to add file i will surely use this for other projects.

Thanks for your reply.

 

 

Thank you Doug, for providing solution. Actually the concept which you explained worked in my case as we were instructed not to cross 'N' number of lines in code hence i used connection.filemanager.addfile.

 

 

Thank you Doug, Thank you Dave for providing guidance.

 

 

rgds

Amit

 

Senior Software Engineer

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

Post to forums  

Autodesk Design & Make Report