PDA

View Full Version : WriteData for UChar[]



Anders Ohrt
9-Jan-2015, 04:03 AM
Hi DAW!

Now that we can use UChar[] to work with binary data, can we get a WriteBinary, similar to WriteHtml and WriteData, that outputs the binary data directly to a web client? This way, an image read from the DB, or a PDF created in memory using VPE, can be streamed directly to the client without needing to save it to disk first.

I asked this during the webinar, but did not get an answer.

Raphael Theiler
9-Jan-2015, 04:30 AM
Have you tried WriteData?

Peter van Mil
9-Jan-2015, 04:43 AM
+1

Streaming a PDF from memory directly to the client would be great!

Richard Hogg
9-Jan-2015, 05:19 AM
+ 1

Raphael Theiler
9-Jan-2015, 05:40 AM
There you go:


Procedure WriteUChar UChar[] uData
Address pData
Move (AddressOf(uData)) to pData
Send OutputData to ghInetSession pData
End_Procedure

Anders Ohrt
9-Jan-2015, 06:28 AM
Have you tried WriteData?

WriteData doesn't work because it stops when it gets a NULL character.

And I think it does an OEM-ANSI conversion too.

Raphael Theiler
9-Jan-2015, 07:23 AM
WriteData doesn't work because it stops when it gets a NULL character.

And I think it does an OEM-ANSI conversion too.

Yes, you are right.
Let's hope it will be fixed/added (hopefully without introducing fancy bugs... especially in the WebServices).

Anders Ohrt
23-Jan-2015, 02:03 AM
Bump! No-one at DAW have a comment?

Dennis Piccioni
27-Jan-2015, 05:28 PM
Hi Anders,

we're looking into it, but it's still at the research stage.

Anders Ohrt
28-Jan-2015, 01:18 AM
Hi Dennis,


we're looking into it, but it's still at the research stage.

Ok, thanks.

Please note that it's a security issue as well. Using ASP upload, the IIS user needs to be able to read all files you want to transfer. This means you either need to copy the files into the AppHtml directory (potentially exposing them to everyone) or allow the IIS user to read the files from some other directory (potentially opening a hole into your internal network).