Link to home
Start Free TrialLog in
Avatar of Insoftservice inso
Insoftservice insoFlag for India

asked on

Display pdf without downloading on local m/c

I want to display pdf without downloading the pdf on local server in fancy box.
<?php
	
	$ftp_server="serverip";
	$ftp_user_name = "username"; 
	$ftp_user_pass = "password";
	$conn_id = ftp_connect($ftp_server); 
	$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
	ftp_pasv($conn_id, TRUE);
	
	if ((!$conn_id)) { 
		echo "FTP connection failed";
		exit; 
	} 
	else {
		//echo "Connected to $ftp_server";
	}
	//$list=ftp_nlist($conn_id, "");
	foreach (ftp_nlist($conn_id, "") as $element) 
	{
		echo "<a class='fancypdf' data-fancybox-type='iframe' href='ftp://varun:varun123@serverip/$element'>". $element ."</a></br>";
	}
	
	
	
	
	
	
	ftp_close($conn_id);
?>
<html>
<head>
	<script type="text/javascript" src="fancybox/lib/jquery-1.10.1.min.js"></script>
	<script type="text/javascript" src="fancybox/source/jquery.fancybox.js?v=2.1.5"></script>
	<link rel="stylesheet" type="text/css" href="fancybox/source/jquery.fancybox.css?v=2.1.5" media="screen" />
	
	<script type="text/javascript">
		$(document).ready(function(){
			$(".fancypdf").fancybox({
                'frameWidth': 680,
                'frameHeight':495,
                'overlayShow':true,
                'hideOnContentClick':false,
                'type':'iframe'
			});
		});
	</script>
</head>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Insoftservice inso

ASKER

Do you mean to say @ray that above method is downloading on local server and later deleting it.
If yes then can where actually its saving on client mc

sorry my mistake it gets stores on the server where script is written please correct me if i am wrong. I hope even if it gets downloaded on server side it has no issue thx.
SOLUTION
Avatar of Jim Riddles
Jim Riddles
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial