PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
nincha
Forum Contributor
Posts: 191 Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA
Post
by nincha » Tue Aug 23, 2005 7:36 pm
any way to use php to allow a user to download a file through a ssl connection?
nielsene
DevNet Resident
Posts: 1834 Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA
Post
by nielsene » Tue Aug 23, 2005 8:21 pm
Do you mean without having SSL running on the server?
If you already have an SSL cert, then just making a normal link to the file using https:// will instruct the browser to use SSL...
nincha
Forum Contributor
Posts: 191 Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA
Post
by nincha » Tue Aug 23, 2005 8:26 pm
well im using this code to download a file
Code: Select all
if(is_file('/home/path/to/directory/'.$gallery."/".$file)){
header("Cache-control: private");
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=".$file);
header("Content-length: ".filesize($gallery."/".$file)."\n");
//send file contents
$fp=fopen($gallery."/".$file, "r");
fpassthru($fp);
}
it works fine through http protocol, but gives me an error through https
nincha
Forum Contributor
Posts: 191 Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA
Post
by nincha » Wed Aug 24, 2005 12:32 am
any one???
nincha
Forum Contributor
Posts: 191 Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA
Post
by nincha » Wed Aug 24, 2005 11:15 am
has any one run into this problem before?
Grim...
DevNet Resident
Posts: 1445 Joined: Tue May 18, 2004 5:32 am
Location: London, UK
Post
by Grim... » Wed Aug 24, 2005 11:17 am
What's the error?
Grim...
DevNet Resident
Posts: 1445 Joined: Tue May 18, 2004 5:32 am
Location: London, UK
Post
by Grim... » Wed Aug 24, 2005 11:18 am
I would say read all the user comments on this page:
http://uk2.php.net/header , but you've already done that, right?
nincha
Forum Contributor
Posts: 191 Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA
Post
by nincha » Wed Aug 24, 2005 11:33 am
hmm, it seems like it works fine before i call the session_start();
blah, got to use a diferent method of save variables now.