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: 

Conversion of File to ByteArray

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
amitnkukanur
1346 Views, 2 Replies

Conversion of File to ByteArray

Hello,

I know this is a silly question, but i am stuck up with conversion of file to ByteArray. Can some body please suggest me how to convert a file to ByteArray. 

 

My Problem is i have to add a file to Vault 2013 using C#. If a solution link is provided that would be help full

 

 

Rgds

Amit

Senior Software Engineer
2 REPLIES 2
Message 2 of 3
Redmond.D
in reply to: amitnkukanur

You are not the first to get confused between byte[] and ByteArray.  The VaultFileBrowser sample in the SDK has an example.

 

The basic steps are:

  1. Read in the local file as a byte[].  You can do this using a System.IO.FileStream or calling System.IO.File.ReadAllBytes.
  2. Create a new ByteArray object and set the 3 properties.  For simplicity, I suggest not using compression.
  3. Pass in the ByteArray object to the Add or CheckIn function.

 

 

 



Doug Redmond
Software Engineer
Autodesk, Inc.

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

Perfect, thanks for solution. It worked.

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