月份: 2018-01

php环境wamp2.5下载地址

php环境wamp2.5下载地址

https://sourceforge.net/projects/wampserver/files/WampServer%202/Wampserver%202.5/

WampServer 2.5 – 32 and 64 bits

Be sure that you have installed Visual C++ Redistributable for Visual Studio 2012 : VC11 vcredist_x64/86.exe
http://www.microsoft.com/en-us/download/details.aspx?id=30679

Don’t Use previous WampServer Extensions/Addons. 
There are no more compatible with the new wampserver version’s (VC11)

Apache     : 2.4.9
MySQL      : 5.6.17
PHP        : 5.5.12
PHPMyAdmin : 4.1.14
SqlBuddy   : 1.3.3
XDebug     : 2.2.5

Source: readme.txt, updated 2014-05-01

通过php下载文件并重命名

通过php下载文件并重命名

$filename = dirname(__FILE__) . '/oldfilename.jpg';
$out_filename = 'newfilename.jpg';
if( ! file_exists($filename)){
  echo 'Not Found' . $filename;
  exit;
} else {
  // We'll be outputting a file
  header('Accept-Ranges: bytes');
  header('Accept-Length: ' . filesize($filename));
  // It will be called
  header('Content-Transfer-Encoding: binary');
  header('Content-type: application/octet-stream');
  header('Content-Disposition: attachment; filename=' . $out_filename);
  header('Content-Type: application/octet-stream; name=' . $out_filename);
  // The source is in filename
   if(is_file($filename) && is_readable($filename)){
    $file = fopen($filename, "r");
    echo fread($file, filesize($filename));
    fclose($file);
   }
  exit;
}