Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Posting Binary Data from OCX to DataBase URGENT!!!!!

Status
Not open for further replies.

rajeessh

Programmer
Apr 11, 2002
207
0
0
IN
I have an activex control that has a method that returns binary data.I try bto fetch thru javascript and it works out ok. When i try to place it in hidden control and post thru a form to ASP and do a request.Form in that the content
is different.
Am i missing somethings.
I need to post the data and save it in DB
retrive and show it in form thru activeX.
Any help would be of great thanx.
 
Your code would be nice to debug.

codestorm
Fire bad. Tree pretty. - Buffy
Kludges are like lies.
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
If your actually writing the binary data to an input your going to run into problems unless your very very careful with the size of the data. Since HTML is a text format the browser will attempt to convert any binary data sent to it in an HTML page to text, which means that unless your binary data is able to be converted exactly to characters, then the binary data will join with the binary data that comes later, such as end quotes for your value= and so on.

It would probably be safer if you attempt to make your OCX zerofill the data somehow so that you have a number evenly divisible by 8. This way the browser can (hopefully) easily convert the data to ASCII characters.

The problem with this approach is that any of those characters could come out as a quote or something similar that wil disrupt your HTML. Another approach would be to write the binary data to a string as hexadecimal values, this will not only remove the risk of getting unwanted characters, but also any risk of uneven binary data, as you will need to zero fill somewhere in order to make everything evenly divisible.

-Tarwn

[sub]01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101 [/sub]
[sup]29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19[/sup]
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top