Announcement
Collapse
No announcement yet.
X
-
Hi Wally, please see the docs for rpcRequest.useSimpleHttp. Those docs cover the properties that are valid with that mode.
-
Originally posted by Isomorphic View PostAs covered above, downloadResult is a property that is used with the SmartClient Server, which you are not using. So it does not apply to you.
Presumably, you were hoping for something specific to happen.. please start a new thread explaining what you wanted to happen, and we can then help you to do it.
Leave a comment:
-
As covered above, downloadResult is a property that is used with the SmartClient Server, which you are not using. So it does not apply to you.
Presumably, you were hoping for something specific to happen.. please start a new thread explaining what you wanted to happen, and we can then help you to do it.
Leave a comment:
-
Is this still relevant? I'm using SmartClient 13 (v13.0p_2023-08-01/LGPL Deployment) in combination with RubyOnRails back-end. I'm trying to retrieve a PDF file using this code:
Code:isc.RPCManager.sendRequest({ actionURL: `file.pdf`, downloadResult: true, httpMethod: 'GET', useSimpleHttp: true });
Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.
Leave a comment:
-
The downloadResult property is also a property that makes sense to use only with the SC Server (and the hiddenFrame protocol only works with the SC Server).
Leave a comment:
-
OK, sorry to forget mention that.
As I say, I putted useSimpleHttp to true and I still have the <transaction> wrapper.
I don't know if it's in relation but I can observe the following behaviour when I ran RPCManager.sendRequest() in debug :
If downloadResult = false, request.transport = xmlHttpRequest.
But if downloadResult = true, request.transport is enforced to hidden.
Leave a comment:
-
Please remember to mention in the future that you are not using the server framework - that's kind of important to know.
The <transaction> wrapper is part of the protocol used to contact the server framework. useSimpleHttp:true does get rid of it (you seem to say it doesn't, but it does).
Note that "exportDisplay" does not make any sense to set here.
Leave a comment:
-
I don't post server-code because we don't use it. I forgot to put useSimpleHttp : true in the front-end I've posted.
I just wanted to call my backend (which is not SC) and download the result as a file, that's why I use the param downloadResult.
But when my payload is serialized, it's wrapped in a <transaction> element so the backend is not able to deserialize it because it doesn't this element <transaction>...
Any idea to get rid of this wrapper?
PS : The backend return an Excel file, and put these headers to the HTTP response
Content-type : "application/vnd.ms-excel"
Content-disposition : "attachment;filename=myfile.xlsx"
Leave a comment:
-
See the Upload / Download folder for sample code for doing this. You didn't post server-code but you are probably missing the call to doCustomResponse at least.
Leave a comment:
-
downloadResult and POST data
Hi,
Using SmartClient_v90p_2014-01-24_Pro (Google Chrome), I'm having an issue with DSRequest.downloadResult and POST data.
We want to fetch server to generate an excel file. We have to use a POST because we need to include a picture in the excel which is generated from a SVG that we give in the request payload.
So I use the following code
Code:var svg = 'SVG to send'; RPCManager.sendRequest({ actionURL : url, httpMethod : 'POST', contentType : 'text/html', exportDisplay : 'window', downloadResult : true, downloadToNewWindow : true, httpHeaders : { 'Accept' : 'application/vnd.ms-excel' }, showPrompt : false, data : svg });
The payload I catch with Fiddler is something like the following (after some transformation to be easier to read)
Code:_transaction= <transaction+xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"+xsi:type="xsd:Object"> <transactionNum+xsi:type="xsd:long">29</transactionNum> <operations+xsi:type="xsd:List"> <elem>My SVG</elem> </operations> <jscallback>if+%28%21%28new+RegExp%28"%5E%28%5C%5Cd%7B1%2C3%7D%5C%5C.%29%7B3%7D%5C%5Cd%7B1%2C3%7D%24"%29.test%28document.domain%29%29%29+%7Bwhile+%28%21window.isc+&&+document.domain.indexOf%28"."%29+%21=+-1+%29+%7B+try+%7B+parent.isc;+break;%7D+catch+%28e%29+%7Bdocument.domain+=+document.domain.replace%28/.*%3F%5C./%2C+""%29;%7D%7D%7Dparent.isc.Comm.hiddenFrameReply%2829%2Cresults%29</jscallback> </transaction> &protocolVersion=1.0&__iframeTarget__=request_1399900588089
When downloadResult is false the payload contains only the data and my param is valued so I can use it.
Any idea to get a payload which contains only the SVG we want to send and don't data wrapped in a transaction?
Thanks for your helpTags: None
Leave a comment: