Jump to content

Ready/write any format file as binary format


Recommended Posts

Dear,

I think we can store any format file as binary in db. So I have a trial to read a .zip file as binary, and then convert binary array to a string, which I'll save into db in another vi.

Why don't I use Byte Array To String.vi to convert binary array to string? Because many characters are not alphanumeric, which can't be recognized by DB.

My question is, why I can't open the new created .zip file?

Please see the picture below, I'm confused very much, data 1 are absolutely same as data 2.

Please copy 1.zip to c:\ while you help me debug the vi.

Link to comment

QUOTE (labc @ Apr 14 2009, 08:16 AM)

My question is, why I can't open the new created .zip file?

The data 1 might be equal to data 2 in terms of values, but the representation is different.

Notice the red dot when you write data to the data 2 terminal, this dot represents a coercion, i.e. a conversion between one representation to another.

I have not opened the code, but my guess is that when you write data to the new zip file, you are actually writing data as I32 values, not U8.

The solution would be to specify the data type when you are converting from string to numeric.

/J

Link to comment

QUOTE (JFM @ Apr 14 2009, 09:15 AM)

The data 1 might be equal to data 2 in terms of values, but the representation is different.

Notice the red dot when you write data to the data 2 terminal, this dot represents a coercion, i.e. a conversion between one representation to another.

I have not opened the code, but my guess is that when you write data to the new zip file, you are actually writing data as I32 values, not U8.

The solution would be to specify the data type when you are converting from string to numeric.

/J

JFM,

You're right, It works after adding one "To Unsigned Byte Integer.vi". Thank you.

Labc

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.