daily pastebin goal
81%
SHARE
TWEET

[COD]: Forçando o download de arquivo

garfield May 7th, 2011 303 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. //              @Author: [iPs]SuYaNw
  3.  
  4.         function ForceDownloadFile($arquivo)
  5.         {
  6.                 if(!file_exists($arquivo)) return false;
  7.                 $tipo = strstr($arquivo,'.');
  8.                 header("Content-Type: ".$tipo);
  9.                 header("Content-Length: ".filesize($arquivo));
  10.                 header("Content-Disposition: attachment; filename=".basename($arquivo));
  11.                 readfile($arquivo);
  12.         }
  13. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top