Page 1 of 1
ssl
Posted: Tue Aug 23, 2005 7:36 pm
by nincha
any way to use php to allow a user to download a file through a ssl connection?
Posted: Tue Aug 23, 2005 8:21 pm
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...
Posted: Tue Aug 23, 2005 8:26 pm
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
Posted: Wed Aug 24, 2005 12:32 am
by nincha
any one???
Posted: Wed Aug 24, 2005 11:15 am
by nincha
has any one run into this problem before?
Posted: Wed Aug 24, 2005 11:17 am
by Grim...
What's the error?
Posted: Wed Aug 24, 2005 11:18 am
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?
Posted: Wed Aug 24, 2005 11:33 am
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.