Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Send files from servlet to client for downloading

    I have a rpc call to servlet which streams out a pdf document
    the fileservlet.java

    when hit on browser http://localhost/fileservlet correctly streams out the file but in smartclient its not streaming, please help

    Code:
     isc.RPCManager.sendRequest({
    	    actionURL: "../../fileservlet",
    	    showPrompt:false,
    	    prompt:"Searching records ..",
    	    willHandleError:true, 					    
    	    data: {				         
    		    }
    	    ,callback: function(rpcResponse, data, rpcRequest){
    	    	isc.clearPrompt();
    	    	isc.logWarn(".. status="+rpcResponse.status);
    	    	if(!rpcResponse || rpcResponse.status==-1){
    	    		handleGenericError(data,rpcResponse);
    	    	}
    	    	else{
    	    		_itemList.setData(rpcResponse.data.gridData); 
    	    	}
    		}     
    	});
    and the fileservlet is registered in web.xml and also checks for mime type, and it works independtly when hit http://localhost/fileservlet

    #2
    RPCManager is used for structured communications with the SmartClient server. It does not apply to your own, hand-written Servlet.

    A typical way to initiate a download with such a Servlet is just to set window.location to the URL of the Servlet.

    Comment

    Working...
    X