[PHP] How do I open Save As Dialog Box?

2004-08-23 Thread PHP Junkie
Ave,

I'm facing a little problem.
I have created a File Manager Application for my company which has a place
where authorized users can download the stored files. The files are of
various MIME Types.. Mainly PDF, TXT  DOC.
What I want to do is basically... When the user clicks on the Download
Button... The Save As Dialog Box should appear...
What is happening right now is that the file opens in it's related software
(Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
native software.

I know I need to use the
header (Content-type: application/octet-stream);
But I don't know how.

Can anyone help?

Thanks.

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



Re: [PHP] How do I open Save As Dialog Box?

2004-08-23 Thread John Holmes
From: PHP Junkie [EMAIL PROTECTED]
I have created a File Manager Application for my company which has a place
where authorized users can download the stored files. The files are of
various MIME Types.. Mainly PDF, TXT  DOC.
What I want to do is basically... When the user clicks on the Download
Button... The Save As Dialog Box should appear...
What is happening right now is that the file opens in it's related 
software
(Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
native software.

I know I need to use the
header (Content-type: application/octet-stream);
But I don't know how.
Read the first comment here: http://us4.php.net/readfile
---John Holmes... 

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


Re: [PHP] How do I open Save As Dialog Box?

2004-08-23 Thread John Nichel
PHP Junkie wrote:
Ave,
I'm facing a little problem.
I have created a File Manager Application for my company which has a place
where authorized users can download the stored files. The files are of
various MIME Types.. Mainly PDF, TXT  DOC.
What I want to do is basically... When the user clicks on the Download
Button... The Save As Dialog Box should appear...
What is happening right now is that the file opens in it's related software
(Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
native software.
I know I need to use the
header (Content-type: application/octet-stream);
But I don't know how.
Can anyone help?
Thanks.
http://us4.php.net/readfile
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How do I open Save As Dialog Box?

2004-08-23 Thread Torsten Roehr
Php Junkie [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Ave,

 I'm facing a little problem.
 I have created a File Manager Application for my company which has a place
 where authorized users can download the stored files. The files are of
 various MIME Types.. Mainly PDF, TXT  DOC.
 What I want to do is basically... When the user clicks on the Download
 Button... The Save As Dialog Box should appear...
 What is happening right now is that the file opens in it's related
software
 (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
 native software.

 I know I need to use the
 header (Content-type: application/octet-stream);
 But I don't know how.

 Can anyone help?

 Thanks.

Take a look at PEAR's HTTP_Download:
http://pear.php.net/package/HTTP_Download

This package is exactly what you are looking for.

Regards, Torsten Roehr

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



Re: [PHP] How do I open Save As Dialog Box?

2004-08-23 Thread Daniel Schierbeck
Php Junkie wrote:
Ave,
I'm facing a little problem.
I have created a File Manager Application for my company which has a place
where authorized users can download the stored files. The files are of
various MIME Types.. Mainly PDF, TXT  DOC.
What I want to do is basically... When the user clicks on the Download
Button... The Save As Dialog Box should appear...
What is happening right now is that the file opens in it's related software
(Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
native software.
I know I need to use the
header (Content-type: application/octet-stream);
But I don't know how.
Can anyone help?
Thanks.
Try using header(Content-type: application/force-download)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How do I open Save As Dialog Box?

2004-08-23 Thread PHP Junkie

Ave,

IT WORKS!!
There wasn't one bit of a problem..
I'll just paste the code here again for anyone who might be looking for it.
I guess I was very close to it but just doing one thing wrong... I wasn't
specifying the Basename directive.

?php
$file = $P/$F;
header(Content-Description: File Transfer);
header(Content-Type: application/force-download);
header(Content-Disposition: attachment; filename=.basename($file));
@readfile($file);
? 

Although this doesn't work on MAC... It works on Windows .. In Mac it still
opens up the file in it's supported software. But it's not an issue for me.

Thanks a ton guys...



On 8/23/04 10:51 AM, John Holmes [EMAIL PROTECTED] wrote:

 From: PHP Junkie [EMAIL PROTECTED]
 
 I have created a File Manager Application for my company which has a place
 where authorized users can download the stored files. The files are of
 various MIME Types.. Mainly PDF, TXT  DOC.
 What I want to do is basically... When the user clicks on the Download
 Button... The Save As Dialog Box should appear...
 What is happening right now is that the file opens in it's related
 software
 (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
 native software.
 
 I know I need to use the
 header (Content-type: application/octet-stream);
 But I don't know how.
 
 Read the first comment here: http://us4.php.net/readfile
 
 ---John Holmes... 

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



Re: [PHP] How do I open Save As Dialog Box?

2004-08-23 Thread Jonathan Haddad
In Safari it'll download the file and then open it. 

Jon
PHP Junkie wrote:
Ave,
IT WORKS!!
There wasn't one bit of a problem..
I'll just paste the code here again for anyone who might be looking for it.
I guess I was very close to it but just doing one thing wrong... I wasn't
specifying the Basename directive.
?php
$file = $P/$F;
header(Content-Description: File Transfer);
header(Content-Type: application/force-download);
header(Content-Disposition: attachment; filename=.basename($file));
@readfile($file);
? 

Although this doesn't work on MAC... It works on Windows .. In Mac it still
opens up the file in it's supported software. But it's not an issue for me.
Thanks a ton guys...

On 8/23/04 10:51 AM, John Holmes [EMAIL PROTECTED] wrote:
 

From: PHP Junkie [EMAIL PROTECTED]
   

I have created a File Manager Application for my company which has a place
where authorized users can download the stored files. The files are of
various MIME Types.. Mainly PDF, TXT  DOC.
What I want to do is basically... When the user clicks on the Download
Button... The Save As Dialog Box should appear...
What is happening right now is that the file opens in it's related
software
(Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
native software.
I know I need to use the
header (Content-type: application/octet-stream);
But I don't know how.
 

Read the first comment here: http://us4.php.net/readfile
---John Holmes... 
   

 

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


Re: [PHP] How do I open Save As Dialog Box?

2004-08-23 Thread PHP Junkie
Ave,

Yes indeed that's what it's doing. But that's ok... My main concern was for
Windows users because that's the majority of the users for this application.

Thanks.



On 8/23/04 12:50 PM, Jonathan Haddad [EMAIL PROTECTED] wrote:

 In Safari it'll download the file and then open it.
 
 Jon
 
 PHP Junkie wrote:
 
 Ave,
 
 IT WORKS!!
 There wasn't one bit of a problem..
 I'll just paste the code here again for anyone who might be looking for it.
 I guess I was very close to it but just doing one thing wrong... I wasn't
 specifying the Basename directive.
 
 ?php
 $file = $P/$F;
 header(Content-Description: File Transfer);
 header(Content-Type: application/force-download);
 header(Content-Disposition: attachment; filename=.basename($file));
 @readfile($file);
 ? 
 
 Although this doesn't work on MAC... It works on Windows .. In Mac it still
 opens up the file in it's supported software. But it's not an issue for me.
 
 Thanks a ton guys...
 
 
 
 On 8/23/04 10:51 AM, John Holmes [EMAIL PROTECTED] wrote:
 
  
 
 From: PHP Junkie [EMAIL PROTECTED]
 

 
 I have created a File Manager Application for my company which has a place
 where authorized users can download the stored files. The files are of
 various MIME Types.. Mainly PDF, TXT  DOC.
 What I want to do is basically... When the user clicks on the Download
 Button... The Save As Dialog Box should appear...
 What is happening right now is that the file opens in it's related
 software
 (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
 native software.
 
 I know I need to use the
 header (Content-type: application/octet-stream);
 But I don't know how.
  
 
 Read the first comment here: http://us4.php.net/readfile
 
 ---John Holmes...

 
 
  
 

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