__soapCall('GetToken', array(array( 'username' => $username, 'password' => $password )))->GetTokenResult; $scRLS->TokenHeader = $token; echo("
" .$token ."
"); */ /* object token = rlaLOCAL.GetToken(username, password); if (token != null) { // Token will be null if authentication has been disabled or if an error has occured. thLOCAL.Token = token.ToString(); clsWebServiceInitialisation.thLOCAL = thLOCAL; clsWebServiceInitialisation.rlsLOCAL.TokenHeaderValue = thLOCAL; } */ $filepath = $scRLS->__soapCall('IsMyDownloadActivated', array(array( 'membershipID' => $membershipID, 'digitalContentSkuID' => $digitalContentSkuID, 'digitalContentID' => $digitalContentID, 'downloadSourceID' => $downloadSourceID, 'setStatusToFalse' => $setStatusToFalse, 'updateLog' => $updateLog )))->IsMyDownloadActivatedResult; //echo($filepath); if (strlen($filepath) == 0 || substr($filepath,0, 1) == '[') { // Initiate download. echo("Download not activated."); throw new Exception("Download not activated."); } else { if(!file_exists($filepath)) { throw new Exception("File not found."); } else { //echo ($filepath ."\n" ); $filesize = filesize($filepath); $lastSlashIndex = strrpos($filepath, '/'); $filename = substr($filepath, $lastSlashIndex + 1); //echo ("Last Slash: " .$lastSlashIndex ."\n"); //echo ($filename ."\n" ); header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: private', false); header('Content-Description: File Transfer'); header('Content-Type: application/force-download'); header('Content-Length: ' .$filesize); header('Content-Transfer-Encoding: binary'); header('Content-Disposition: attachment; filename=' .$filename); // Will this work? header('Vary: User-Agent'); set_time_limit(0); readfile($filepath) or die("File not found."); } } } catch(Exception $e) { echo 'Message: ' .$e->getMessage(); } ?>