View Full Version : [CLOSED] Reponse Type on a direct method

Aug 25, 2017, 7:54 PM

I am trying to return a byte array from server side code to jscript via a direct method and cant get it working. Is this the correct syntax? The below succeeds but returns a string as opposed to the byte array.

App.direct.MyMethod(p1, {
responseType: 'arraybuffer',
xhr2: true,
success: function (result) {

public byte[] MyMethod(p1)

Aug 28, 2017, 11:42 AM
You can close this as it can't be an Ext problem as I created a c# handler and called it directly from an xmlhttprequest and nothing is returned.

Solutions I found for my problem were

1. Convert the base64 string on the client (direct method) or
2. Just write the entire stream from the handler to the reponse and using an object tag or iframe to display the content

Aug 28, 2017, 8:29 PM
Hello @CanopiusApplications!

Thanks for the proactive feedback! And this makes sense. Best I can think using Ext.NET would what you said. Encapsulating the binary data (base64 or MIME are good ways), and return them as string, then working with that on the callback.

Other than that, it could involve actually making it act as a download and write the data to the "download" stream then working with that. Which involves making Ext.NET not handle the response at all.

Aug 29, 2017, 7:50 AM
Hi Fabricio

Yeah ultimately what I did was simply write everything to the stream and work with that. I got the base64 conversion, then blob & then createObjectURL working however I thought it must be slower this way given the conversions and pretty sure I read somewhere there are size limits with the base64 string.

A related thread here : https://forums.ext.net/showthread.php?62083-CLOSED-TabPanel-and-Iframe

Thanks for responding,