Change the link to form_download.php then create a file called
form_download.php and do this:

<?php

header("Content-type: application/msword");
header("Content-Disposition: attachment; filename=form.doc"); 
readfile("form.doc");
exit();

?>

That will do it for you.

Also you should reply to all and include the list when replying so all
get to see
how to do these things.



Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]


> -----Original Message-----
> From: Shaun van den Berg [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, 21 January 2003 8:19 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] DOWNLOAD
> 
> 
> Hi Timothy,
> 
> I dont understand , im a rookie so go easy on me. I have a 
> form.doc file ! My code looks like this <a 
> href="form.doc">click to download</a>, this was wat somebody 
> else told me to do , but when i click on the link it opens 
> the document in word rather than downloading it ? I dont 
> under stand these headers yet , do i need to configure the 
> ini file , can i do this with doc containing pics ect.
> 
> Thanks
>     Shaun
> 
> ----- Original Message -----
> From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
> To: "'Shaun van den Berg'" <[EMAIL PROTECTED]>; 
> <[EMAIL PROTECTED]>
> Sent: Tuesday, January 21, 2003 11:44 AM
> Subject: RE: [PHP] DOWNLOAD
> 
> 
> > Create a script that reads the contents of a file after sending 
> > headers
> > eg:
> >
> > header("Content-type: text/plain");
> > header("Content-Disposition: attachment; filename=downloaded.txt"); 
> > readfile("downloaded.txt"); exit();
> >
> > The downloaded.txt can be any file subject to sending the correct 
> > headers and IE and other browsers will pop up a download (save) 
> > window.
> >
> > See your mime.types file for headers for each file type.
> >
> >
> > Timothy Hitchens (HiTCHO)
> > Open Source Consulting
> > e-mail: [EMAIL PROTECTED]
> >
> > > -----Original Message-----
> > > From: Shaun van den Berg [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, 21 January 2003 4:39 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] DOWNLOAD
> > >
> > >
> > > Hi ,
> > >
> > > Im not sure if this can be done in PHP , i know PHP has upload 
> > > features ! Does it have download features , wat i mean is the 
> > > following : i want a link - click here to download - when 
> you click 
> > > on it , the download dialog box must appear - how do i do this ?
> > >
> > > Thanks
> > >     Shaun van den Berg
> > >
> > > --
> > > Novtel Consulting
> > > Tel: +27 21 9822373
> > > Fax: +27 21 9815846
> > > Please visit our website:
> > > www.novtel.co.za
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to