Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Jak zabezpieczyć pliki przed pobieraniem?
d.stp
post
Post #1





Grupa: Zarejestrowani
Postów: 358
Pomógł: 0
Dołączył: 19.04.2012

Ostrzeżenie: (0%)
-----


Witam, jaki jest najlepszy sposób na zabezpieczenie plików (.rar) przed ich ściągnięciem? Bo mam serwis, który po wysłaniu SMSa daje możliwość pobrania czegoś, ale jak ktoś zna link to może pobrać ten plik bez żadnego problemu ;/
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
d.stp
post
Post #2





Grupa: Zarejestrowani
Postów: 358
Pomógł: 0
Dołączył: 19.04.2012

Ostrzeżenie: (0%)
-----


Dalej mam problem... pliki mam normalnie w folderze downloads w htdocs i do tamtego folderu wrzuciłem plik htaccess z regułą DENY FROM ALL, ale teraz jak chcę pobrać plik to zajmuje on 0 bajtów...

Kod:

  1. $file = 'FULL_ADRESS downloads/'.$_file;
  2.  
  3. header('Content-Description: File Transfer');
  4. header('Content-Type: application/octet-stream');
  5. header('Content-Disposition: attachment; filename='.basename($file));
  6. header('Content-Transfer-Encoding: binary');
  7. header('Expires: 0');
  8. header('Cache-Control: must-revalidate');
  9. header('Pragma: public');
  10. header('Content-Length: ' . filesize($file));
  11. flush();
  12. readfile($file);


Jak usunę plik htaccess to jest ok...

Ten post edytował d.stp 14.04.2013, 19:38:21
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 10:56