May 01, 2014, 8:32 AM
[CLOSED] Treepanel / leaf click / download file
Hi
I am having some trouble downloading a file on a click on a treepanel leaf.
What I have so far is the listener on the panel
and the direct method
I am having some trouble downloading a file on a click on a treepanel leaf.
What I have so far is the listener on the panel
<Listeners>
<ItemClick Handler="if (record.data.leaf) { App.direct.onDownload({buffer:300, isUpload:true, method:GET}); }"></ItemClick>
</Listeners>
do I need this formProxyArg? And if yes, what if I have a treepanel instead of a form?and the direct method
[DirectMethod]
public void onDownload()
{
Response.Clear();
Response.ContentType = "application/octet-stream";
//Response.ContentEncoding = System.Text.Encoding.Default;
Response.AddHeader("content-disposition", "filename=" + "test.pdf");
Response.TransmitFile(@"c:\\temp\test.pdf");
Response.End();
}
Thank you very much for your insight.
Last edited by Daniil; May 13, 2014 at 4:16 PM.
Reason: [CLOSED]