ssl

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

Post Reply
nincha
Forum Contributor
Posts: 191
Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA

ssl

Post by nincha »

any way to use php to allow a user to download a file through a ssl connection?
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

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 »

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 »

any one???
nincha
Forum Contributor
Posts: 191
Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA

Post by nincha »

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... »

What's the error?
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

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 »

hmm, it seems like it works fine before i call the session_start();
blah, got to use a diferent method of save variables now.
Post Reply