8.2.7 JavaScript Samples
Session and folder IDs are fictitious)
<html><head>
<script language="javascript" src="http:// test.thrudownload.com/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
//download by authenticated user with SessionID
$(function(){
var session = "CcDqiDeTFjxji+TxnB+sDV0utoSPsZpD0U1yocoTSKBMOAGxLxGQbMulr/cMLJ27FHpZe5R2ks+r6a+yn0A40eMQm70bKrpd1u3HsKSsmCPqGz0e7Aq8Ay211kspoWI8rqbfZ0TzXveslkp1XBm88f8GR/cFhQ+d";
var url = “http://test.thruinc.net/ExternalJavaDownload.aspx?”;
url += "&ThruSessionID=" + session;
url += "ThruFiles=" + "0F540NC8ZAMQO, 2CNMH8XKUISGU";
url += "ThruFolders=" + "2CNMH8XKUISGU";
url += "&ThruSuccessUrl=" + escape("http://server/ExtDownload/success.html");
url += "&ThruErrorReportingUrl=" + escape("http://server/ExtDownload/error.html");
$("#f").attr("src", url);
});
</script>
</head>
<body>
<iframe id="f" width="1px" height="1px" src=""></iframe>
</body>
</html>
<html><head>
<script language="javascript" src="http:// test.thrudownload.com/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
//download by using security token
$(function(){
var url = “http://test.thruinc.net/ExternalJavaDownload.aspx?”;
url += "ThruFiles=" + "hLmrvNNh7rMjT%2ffLL27vyQDPXUl%2fUjBKKwurzLAxmopIxotP%2fT20Mz5J180jhG3Soqkz8bB1AV6rz3NMcyYtmm3mdo%2bCLeD0FDfgJZ6cw1Iqs9V%2bR79KsJ1mzfUKGrgQmrOq1NlosLcBtzmoVPW4%2bCqkt%2bbkNBdYoYw8DITFkHd%2fVsEHCnk5pjPd89mDATyjTu4xMCXFVH20lP7tTOU75k61LLSj3X6bHzCuorKcUzp7nuvxve0se9cOdFQ3TA6XH78IMGmdoOz9JgDPITyz1Q";
url += "&ThruSuccessUrl=" + escape("http://server/ExtDownload/success.html");
url += "&ThruErrorReportingUrl=" + escape("http://server/ExtDownload/error.html");
$("#f").attr("src", url);
});
</script>
</head>
<body>
<iframe id="f" width="1px" height="1px" src=""></iframe>
</body>
</html>