We have functionality to view and download files which works fine in 6.5.1. This is usually what we see in the logs during these operations:
2011-04-01 16:25:28,835 INFO [STDOUT] === 2011-04-01 16:25:28,835 [0-13] INFO DSResponse - DSResponse: Map with 3 keys
This is then followed by the file being delivered successfully.
However, with 8.0, we see this in the logs and the file is delivered as a 0-byte file?
2011-04-01 16:37:45,577 INFO [STDOUT] === 2011-04-01 16:37:45,577 [80-4] INFO DSResponse - DSResponse: Map with 3 keys
2011-04-01 16:37:45,577 INFO [STDOUT] === 2011-04-01 16:37:45,577 [80-4] WARN DSResponse - Attempted to call getRecord() on a DSResponse with null DataSource
2011-04-01 16:37:45,577 INFO [STDOUT] === 2011-04-01 16:37:45,577 [80-4] WARN RPCManager - dsResponse.getRecord() returned null when attempting to process a data member of type java.util.HashMap. Can't continue.
Does that give you enough info to provide guidance or is there more debug output you would need? If you need more debug, can you please tell me how to provide greater debug output for DSResponse and RPCManager classes since it appears they are not controlled by a normal log4J configuration.
Ok, well here is the code. I definitely had to do some hack-ish things to get this to work in our environment a few years ago because of difficulties arising from our use of document.domain, https, and hiddenFrame transport.
If there is some new and better way to achieve this, I could give it a try. But, this took a lot of work to get this right back then.
We have exactly the same problem, but your answer is not sufficient for us to solve the problem.
Could you for example complete the codegiven by senordhuff ?
Thanks in advance
Hi, in addition to the code I provided, I’ve added the only other relevant code that I think you might need based on this thread. Let me know if you are looking for something else?
DataSource ds = dsRequest.getDataSource();
//4/1/11..needed to add this for smartclient 8.0
dsResponse.setDataSource(ds);
dsRequest.setDownloadFieldName("attachedFile");
dsRequest.setDownloadFileName(anBO.getAttachedFile Name());
Map responseMap = new HashMap();
responseMap.put("attachedFile" + "_filename", anBO
.getAttachedFileName());
responseMap.put("attachedFile" + "_filesize", anBO
.getAttachedFileSizeInBytes());
responseMap.put("attachedFile", new ByteArrayInputStream(anBO
.getAttachedFile()));
dsResponse.setData(responseMap);
dsRequest.context.response.setHeader("Pragma", "private");
dsRequest.context.response.setHeader("Cache-Control",
"private, must-revalidate");
Thanks, that’s what I did, but the problem seems to be the download_filename. I’ve made exactly like in your code, the string is not empty but when i look in the RPC console, this field is null, as I explained it in the thread :
I’m not sure I’m going to be much more help since the code snippet works in our environment. Your post references “download_filename” whereas my code references “attachedFile_filename”. Is that significant ? If not, this may be a support issue for Isomorphic.