0
我正在使用本地服務器(WAMP/EasyPHP)。我正在嘗試使用ActiveX作爲PHP擴展。Windows上的PHP擴展將文件保存到不同位置
爲了測試我用下面的代碼:
$objZip = new COM("ZipLibrary");
$success = $objZip->UnlockComponent('Unlock code goes here');
if ($success != true)
{
exit('Zip reg error!');
}
$success = $objZip->NewZip("./1.zip");
if ($success != true)
{
exit('New Zip error!');
}
$success = $objZip->AppendString('Sample.txt', 'i love to test');
if ($success != true)
{
exit('Add error!');
}
$success = $objZip->WriteZipAndClose();
if ($success != true)
{
exit('Zip Write error!');
}
$objZip = null;
unset($objZip);
但不是將文件保存到當前目錄(其中PHP文件),它是將文件保存到以下目錄:
c:\Program Files\EasyPHP-12.1\apache\
如何將該文件從該目錄獲取到當前目錄?
哇!謝謝..很多.. dirname(__ FILE__)。 '/1.zip' 這就是竅門:) – user1544570