Re: download file
From: Ken (kkrolski_at_wi.rr.com)
Date: 08/25/04
- Next message: Alvaro G Vicario: "Re: download file"
- Previous message: Pieter Nobes: "Re: activate php in apache 2.0"
- In reply to: Ken: "Re: download file"
- Next in thread: Alvaro G Vicario: "Re: download file"
- Reply: Alvaro G Vicario: "Re: download file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 25 Aug 2004 04:49:18 -0500
header( "Content-Disposition: attachment;
filename=".$_SESSION['pictures'.$i]);
header( "Content-Type:".$_SESSION['pictures'.$i.'_type']);
header( "Content-length: ".$_SESSION['pictures'.$i.'_size']);
header( "Content-Transfer-Encoding: binary" );
readfile($_SESSION['archive_dir_read'].$_SESSION['pictures'.$i]);
I finally was able to save a file from the internet server to my hard drive
thanks to all the help I received from the newsgroup.
For the next person to ask the question about downloading files, a few
pointers.
We know this but do not remember it.
The headers must be before any writing to the display, including html and
echo.
So basically, add a separate page for the headers.
I do have four other questions.
1. How do I define the hard drive directory for the files in the headers?
I added it to the filename, then the file name became the page name,
i.e., file.gif became download.gif download.php is the page file name.
header( "Content-Disposition: attachment;
filename=c:/temp/".$_SESSION['pictures'.$i]); The manual says the directory
name cannot be specified. Is that still true? Any work arounds?
2. Can I download multiple files at one time? Can you suggest a script for
handling multiple files?
3. Is there a way to download the files without going through the file
download box? Open the page and the files download to the specified
directory.
4. Do I need any other headers?
Thanks!!
Ken
- Next message: Alvaro G Vicario: "Re: download file"
- Previous message: Pieter Nobes: "Re: activate php in apache 2.0"
- In reply to: Ken: "Re: download file"
- Next in thread: Alvaro G Vicario: "Re: download file"
- Reply: Alvaro G Vicario: "Re: download file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|