[PHP] Re: download file question...

2004-08-19 Thread Torsten Roehr
Bruce [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 hi...

 i can allow files to be uploaded to my app. are there corresponding
 scripts/code to allow files to be downloaded to the user via the browser??

 just occurred to me that i'll want to do this...

 nothing jumps out at me searching google/php.net for this...

 thanks

What about pointing a link to the file?!?:
a href=/path/to/your/file.pdflink/a

If the file is outside of the webroot root or in a protected directory you
can use PEAR's HTTP_Download:
http://pear.php.net/package/HTTP_Download

Regards, Torsten Roehr

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



[PHP] Re: Download File Problem - text not appearing on downloaded file

2001-11-19 Thread Chris Lee

I dont know if Im pointing out the obvious or if you orgot to post more
code.

?PHP
  header(Content-type: application/octet-stream);
  header(Content-Disposition: attachment; filename=file.txt);
  // get file data rom db or wherever
  echo $data;
?

--

  Chris Lee
  [EMAIL PROTECTED]



Joe Van Meer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there. I managed to get the prompt for a file download when a user
clicks
 on a text link. The file downloads properly to the client machine, howevr,
 when I open up the file there is no content. What do I have to add to the
 following code to get the content sent back to the user?

 Thx Joe :)

 ?PHP

 header(Content-type: application/octet-stream);
 header(Content-Disposition: attachment; filename=file.txt);

 ?






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Download file

2001-08-01 Thread Owen Rudge

 What I need to do, is specify the default directory for this file to be
 saved to.  Does anyone know how to do this?

It's just not possible.

--
Owen Rudge
http://www.owenrudge.co.uk/
http://www.gamearchive.uk.tt/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: Download file

2001-08-01 Thread Karl J. Stubsjoen

Errr... it from ASP (shoot)
are you 100% sure?

-Original Message-
From: Owen Rudge [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 1:12 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Download file


 What I need to do, is specify the default directory for this file to be
 saved to.  Does anyone know how to do this?

It's just not possible.

--
Owen Rudge
http://www.owenrudge.co.uk/
http://www.gamearchive.uk.tt/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: Download file

2001-08-01 Thread Jason Murray

   What I need to do, is specify the default directory for 
   this file to be saved to.  Does anyone know how to do this?
 
  It's just not possible.

 Errr... it from ASP (shoot)
 are you 100% sure?

How would the PHP code know what directories exist on the remote
machine?

You can set the filename, not the directory.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Download file

2001-08-01 Thread Richard Lynch

 header (Content-Disposition: attachment; filename=download.tar);

 readfile($filename);
 ===end code snippet=

 What I need to do, is specify the default directory for this file to be
 saved to.  Does anyone know how to do this?

WILD GUESS:
Some browsers might let you use a full pathname in the filename= bit and
prompt with that pathname, if the user even has such a pathname in the first
place...

If not, there probably isn't any way to do that.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Download file

2001-08-01 Thread Richard Lynch

  Errr... it from ASP (shoot)
  are you 100% sure?

I'm not 100% sure.  How do you do it in ASP?

What headers does ASP send when you do it?

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]