1

I have a php-download script that looks like this:

<?php
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers 
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=\"$file\"");
header("Content-Type: $mimeType");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $size");
// Read the file from disk
readfile($path);
?>

Normally with this I can force my E-Book-Reader (a Sony PRS-T1) to download a file. However, if I use the same script inside of a folder with .htaccess-authentication, the download fails.

On my computer, the download works, no matter if there is a .htaccess-authentication or not.

Can you help me to find the reason for this behaviour of my Ebook-Reader and make downloads inside of protected folders possible?

Thank you!

[edit] The PRS-T1 runs Android. Maybe this issue (link) is the answer - it is simply not possible...?

speendo
  • 13,045
  • 22
  • 71
  • 107
  • 1
    Are you confident the browser is prepared to handle HTTP AUTH? – sarnold May 16 '12 at 23:58
  • well, at least I can access *pages* in htaccess-protected folders – speendo May 17 '12 at 06:51
  • 1
    possible duplicate (first part is the more relevant): http://stackoverflow.com/a/34758866/257319, you should specify your ebook file type(s), so the hidden file (which is protected by the server won't be addressed as a downloadable, also.. you might have a prior rule (at top of the directory tree) dropping the connection as a respond to your device's user-agent... –  Jan 13 '16 at 05:58

0 Answers0