Sending binary data - WeOnlyDo Discussion board

Sending binary data (General questions)

by Roland, Wednesday, February 16, 2005, 17:39 (7031 days ago)

I am just testing your WebServer component in PowerBuilder 9, everything works fine [:smile:], but I do have troubles sending binary data, because response.body is a string, and PB only has zero-terminated
versions of strings, so it stops at the first ch(0).

Is there an easy way (besides saving the binary data to a file and sending it)?

Thanks,

Roland

Re: Sending binary data

by wodSupport, Wednesday, February 16, 2005, 19:19 (7031 days ago) @ Roland

Roland,

I don't think there's convinient (and fast) way to do it. Can you convert your strings to BSTR?

Anyway... If you use binary data, how do you keep in char*?

Re: Sending binary data

by Roland, Wednesday, February 16, 2005, 19:49 (7031 days ago) @ wodSupport

Anyway... If you use binary data, how do you keep in char*?

In PB, there's a binary data type called blob, i create the data in there and want to service it to the browser. What can I do if i cannot use response.body, can i write a file and have wodWebServer send that out?

Re: Sending binary data

by wodSupport, Wednesday, February 16, 2005, 20:13 (7031 days ago) @ Roland

Roland,

yes. When I think more, when you access Body property then wodWebServer internally accesses file defined in Filename property, and reads/writes it for you.

So, you can do it as you suggested - read and write to a file, and then use Request.Filename (or Response.Filename) to point wodWebServer to that file.