php下的msword和pdf浏览下载如何实现
php下的msword和pdf浏览下载怎么实现
小弟正在做一个老师发布论文要求,然后学生上传论文的网站,是毕业作业,老师放假了,没法问,于是就来找各位大大了
我的网站只允许学生上传pdf或msword文件,然后可以下载,除了downlaod.php外,老师在点击文件链接并不一定是立刻下载,而是打开一个浏览界面,可以选择在线看,或者,需要的话,再下载下来,请问怎么实现。。。。或者,要用js实现?
------解决方案--------------------
不是很好控制。设置好header交给浏览器来做。
http://www.cnblogs.com/persy_php/archive/2010/07/21/1782407.html
http://grow.sinaapp.com/?p=667
设置好header,类似下面这样的
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="downloaded.pdf"');
readfile('original.pdf');

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



It is usually necessary to insert PDF documents into Excel worksheets. Just like a company's project list, we can instantly append text and character data to Excel cells. But what if you want to attach the solution design for a specific project to its corresponding data row? Well, people often stop and think. Sometimes thinking doesn't work either because the solution isn't simple. Dig deeper into this article to learn how to easily insert multiple PDF documents into an Excel worksheet, along with very specific rows of data. Example Scenario In the example shown in this article, we have a column called ProductCategory that lists a project name in each cell. Another column ProductSpeci

When working with multiple documents or multiple pages of the same document, you may want to combine them into a single file to share with others. For easy sharing, Apple allows you to merge multiple PDF files into one file to avoid sending multiple files. In this post, we will help you know all the ways to merge two or more PDFs into one PDF file on iPhone. How to Merge PDFs on iPhone On iOS, you can merge PDF files into one in two ways – using the Files app and the Shortcuts app. Method 1: Using Files App The easiest way to merge two or more PDFs into one file is to use the Files app. Open on iPhone

Apple's Live Text feature recognizes text, handwritten notes and numbers in photos or through the Camera app and allows you to paste that information onto any other app. But what to do when you're working with a PDF and want to extract text from it? In this post, we will explain all the ways to extract text from PDF files on iPhone. How to Get Text from PDF File on iPhone [3 Methods] Method 1: Drag Text on PDF The easiest way to extract text from PDF is to copy it, just like on any other app with text . 1. Open the PDF file you want to extract text from, then long press anywhere on the PDF and start dragging the part of the text you want to copy. 2

We usually receive PDF files from the government or other agencies, some with digital signatures. After verifying the signature, we see the SignatureValid message and a green check mark. If the signature is not verified, the validity is unknown. Verifying signatures is important, let’s see how to do it in PDF. How to Verify Signatures in PDF Verifying signatures in PDF format makes it more trustworthy and the document more likely to be accepted. You can verify signatures in PDF documents in the following ways. Open the PDF in Adobe Reader Right-click the signature and select Show Signature Properties Click the Show Signer Certificate button Add the signature to the Trusted Certificates list from the Trust tab Click Verify Signature to complete the verification Let

As a universal file format, PDF files are widely used in various application scenarios, such as e-books, reports, contracts, etc. During the development process, we often need to generate, edit, read and other operations on PDF files. As a scripting language, PHP can also easily complete these tasks. This article will introduce how to use PHP to process PDF files. 1. Generate PDF files There are many ways to generate PDF files, the most common of which is to use the PDF library. PDF library is a tool that generates PDF documents for

Methods include: 1. Use professional document conversion tools; 2. Use online conversion tools; 3. Use virtual printers.

In iOS 17 and MacOS Sonoma, Apple added the ability to open and annotate PDFs directly in the Notes app. Read on to find out how it's done. In the latest versions of iOS and macOS, Apple has updated the Notes app to support inline PDFs, which means you can insert PDFs into Notes and then read, annotate, and collaborate on the document. This feature also works with scanned documents and is available on both iPhone and iPad. Annotate a PDF in Notes on iPhone and iPad If you're using an iPhone and want to annotate a PDF in Notes, the first thing to do is select the PDF file

Solve the problems encountered in downloading PDF files with PHP7 In web development, we often encounter the need to use PHP to download files. Especially downloading PDF files can help users obtain necessary information or files. However, sometimes you will encounter some problems when downloading PDF files in PHP7, such as garbled characters and incomplete downloads. This article will detail how to solve problems you may encounter when downloading PDF files in PHP7 and provide some specific code examples. Problem analysis: In PHP7, due to character encoding and H
