Imported from antiword-0.37.tar.gz.
[antiword.git] / Docs / antiword.old.php
blob8025b24b4174bfb61827643e513048ace9474e09
1 From: Paul Southworth <pauls@etext.org>
2 Subject: antiword PHP script
3 Date: Thu, 24 Oct 2002 14:01:05 -0700 (PDT)
5 Please find attached a trivial example of using a web form to process an
6 uploaded Word doc to text using antiword. Perhaps other antiword users
7 would find it useful.
9 --Paul
12 /* antiword.php
13 A PHP script to convert uploaded MS Word docs to text using antiword.
14 This script is public domain, no copyright.
15 September 11, 2002
16 Paul Southworth
18 function print_form() {
20 <html><head><title>antiword</title></head><body>
21 <form method=post action=antiword.php enctype="multipart/form-data">
22 <input name=upload type=file>
23 <input type=submit name=submit value=convert>
24 </form>
25 </body></html>
28 if ($_FILES['upload']) {
29 header ("Content-type: text/plain");
30 system("/usr/local/bin/antiword " . $_FILES['upload']['tmp_name']);
31 } else {
32 print_form();