labc Posted April 15, 2009 Report Share Posted April 15, 2009 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. Quote Link to comment
Mellroth Posted April 15, 2009 Report Share Posted April 15, 2009 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 Quote Link to comment
labc Posted April 15, 2009 Author Report Share Posted April 15, 2009 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.