• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Byte array manipulation

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there
In a Internet Explorer (client) / BEA WebLogic (server) environment, i'm using an ActiveX that provides access to a small picture (.bmp) as a byte array.
Using form mechanism, i would like to retrieve those data back to the server.
I thought i could set the value of an hidden field and then get it on the server but i've got some trouble handling the bytes....
Do i need to convert, to encode ??
Any info would be appreciated
Thanx in advance
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THe only problem you might have if you are using the query string to submit the data, it would have a cut off limit.
You can encode the data.
The first thing I would do is just make sure you form is submitting the data correctly by placing a default value in the hidden field and see if you find it server side.
Eric
 
Franck Tranchant
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eric,
Actually, i did retrieve something on the server side.
Pretty strange value i'm must say
System.out.println("hiddenImageData= " + request.getParameter("hiddenImageData"));
print the following :
hiddenImageData= 䵂ࣾ
Now I wonder what kind of conversion/decoding i need to perform (client or server side) in order to handle my data properly (which is supposed to represents a small .BMP file)
[ August 18, 2003: Message edited by: Franck Tranchant ]
[ August 18, 2003: Message edited by: Franck Tranchant ]
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So it returns 䵂ࣾ. I would say that is pretty strange. It is returning some unicode characters. I am not sure what the active-X is supposed to be returning.
 
Franck Tranchant
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, as I said, the ActiveX (InkControl) provides access to the raw image data as a byte array.
So, I can store the Data in a JavaScript variable :
<...>
var tempData;
tempData = InkControl.ImageData;
<...>
Then, I can clear the picture and re-display the previously saved picture using my variable :
<...>
InkControl.ImageData = tempData;
InkControl.Refresh();
<...>
This works fine.
The problem is I cannot handle the byte array (tempData in my sample), even on the client side...
What's its size ?
What's inside ?
NB: The ActiveX i'm trying to use is EasyInk.ocx from odysseysoftware.com
Looks great but the documentation and samples is really light ;-)
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can check the lenght of a string....
var tempData;
tempData = InkControl.ImageData;
alert(tempData.length) //tells you the lenght
I would make a very large text area and place the str into it so you can see the string fully.
 
Franck Tranchant
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>var tempData;
>tempData = InkControl.ImageData;
>alert(tempData.length);
That's my problem !
IE tells me : "'length' is not an object"
Amazing isn't it ?
Do you think it's because of the nature of the value returned by the InkControl.ImageData's method ??
>I would make a very large text area and place the str into it so you can see the string fully.
I cannot use textareas since I'm working on very thin client : IE on PocketPC. As far as I know, <INPUT TYPE=textarea> isn't implemented in this version of IE. Only <INPUT TYPE=text> ...
 
reply
    Bookmark Topic Watch Topic
  • New Topic