Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
| Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 3rd, 2004, 09:41 AM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Open a File on the Server

I need to open a file (pdf) for viewing from a PHP page. I have the filenames stored in a DB, and printed out in a list for customers to select which PDF they wish to view. So they need to be able to click on a link, and that file to open for viewing. Any help?

-aingalsbe
  #2 (permalink)  
Old May 3rd, 2004, 08:20 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I'm not sure I understand the mystery. Are these pdf files generated by PHP or stored in a database?

If they're plain-old pdf files all you need to do is output the file path to a hyperlink.

<a href='some/path/file.pdf'>The pdf file</a>

If the browser understands pdf files it'll try and display it, if not it'll prompt the user for download. If Acrobat Reader is installed, Internet Explorer can display pdf files natively. Mozilla is capable of this as well.


Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open a file in another server from SP Andraw SQL Server 2005 0 August 14th, 2008 10:20 AM
open image file from client then save to server hendyhanusin ASP.NET 1.0 and 1.1 Basics 11 March 22nd, 2007 07:28 AM
Open the "Open File" dialogue box piratelordx Access VBA 4 March 14th, 2006 10:08 PM
Can We open database in different server? por Classic ASP Basics 0 December 18th, 2005 09:25 PM
SQL Server cannot open Jane SQL Server 2000 5 December 30th, 2004 01:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.